@Test public void testToModel() { WildflyProviderConfig config = mock(WildflyProviderConfig.class); when(config.getName()).thenReturn(PROVIDER_NAME_VALUE); when(config.getHost()).thenReturn(HOST_VALUE); when(config.getPort()).thenReturn(PORT_VALUE); when(config.getManagementPort()).thenReturn(MANAGEMENT_PORT_VALUE); when(config.getUser()).thenReturn(WILDFLY_USER_VALUE); when(config.getPassword()).thenReturn(WILDFLY_PASSWORD_VALUE); ProviderConfiguration result = converter.toModel(config); assertNotNull(result); assertEquals(PROVIDER_NAME_VALUE, result.getId()); assertEquals(HOST_VALUE, result.getValues().get(HOST)); assertEquals(PORT_VALUE, result.getValues().get(PORT)); assertEquals(MANAGEMENT_PORT_VALUE, result.getValues().get(MANAGEMENT_PORT)); assertEquals(WILDFLY_USER_VALUE, result.getValues().get(WILDFLY_USER)); assertEquals(WILDFLY_PASSWORD_VALUE, result.getValues().get(WILDFLY_PASSWORD)); }
@Override public ProviderConfiguration toModel(WildflyProviderConfig domainValue) { if (domainValue == null) { return null; } final Map<String, Object> values = new HashMap<>(); values.put(PROVIDER_NAME, domainValue.getName()); values.put(HOST, domainValue.getHost()); values.put(PORT, domainValue.getPort()); values.put(MANAGEMENT_PORT, domainValue.getManagementPort()); values.put(WILDFLY_USER, domainValue.getUser()); values.put(WILDFLY_PASSWORD, domainValue.getPassword()); return new ProviderConfiguration(domainValue.getName(), values); }
WildflyProviderConfigConverter implements ProviderConfigConverter<ProviderConfiguration, WildflyProviderConfig> { @Override public ProviderConfiguration toModel(WildflyProviderConfig domainValue) { if (domainValue == null) { return null; } final Map<String, Object> values = new HashMap<>(); values.put(PROVIDER_NAME, domainValue.getName()); values.put(HOST, domainValue.getHost()); values.put(PORT, domainValue.getPort()); values.put(MANAGEMENT_PORT, domainValue.getManagementPort()); values.put(WILDFLY_USER, domainValue.getUser()); values.put(WILDFLY_PASSWORD, domainValue.getPassword()); return new ProviderConfiguration(domainValue.getName(), values); } }
WildflyProviderConfigConverter implements ProviderConfigConverter<ProviderConfiguration, WildflyProviderConfig> { @Override public ProviderConfiguration toModel(WildflyProviderConfig domainValue) { if (domainValue == null) { return null; } final Map<String, Object> values = new HashMap<>(); values.put(PROVIDER_NAME, domainValue.getName()); values.put(HOST, domainValue.getHost()); values.put(PORT, domainValue.getPort()); values.put(MANAGEMENT_PORT, domainValue.getManagementPort()); values.put(WILDFLY_USER, domainValue.getUser()); values.put(WILDFLY_PASSWORD, domainValue.getPassword()); return new ProviderConfiguration(domainValue.getName(), values); } WildflyProviderConfigConverter(); }
WildflyProviderConfigConverter implements ProviderConfigConverter<ProviderConfiguration, WildflyProviderConfig> { @Override public ProviderConfiguration toModel(WildflyProviderConfig domainValue) { if (domainValue == null) { return null; } final Map<String, Object> values = new HashMap<>(); values.put(PROVIDER_NAME, domainValue.getName()); values.put(HOST, domainValue.getHost()); values.put(PORT, domainValue.getPort()); values.put(MANAGEMENT_PORT, domainValue.getManagementPort()); values.put(WILDFLY_USER, domainValue.getUser()); values.put(WILDFLY_PASSWORD, domainValue.getPassword()); return new ProviderConfiguration(domainValue.getName(), values); } WildflyProviderConfigConverter(); @Override Class<ProviderConfiguration> getModelType(); @Override Class<WildflyProviderConfig> getDomainType(); @Override WildflyProviderConfig toDomain(ProviderConfiguration modelValue); @Override ProviderConfiguration toModel(WildflyProviderConfig domainValue); }
WildflyProviderConfigConverter implements ProviderConfigConverter<ProviderConfiguration, WildflyProviderConfig> { @Override public ProviderConfiguration toModel(WildflyProviderConfig domainValue) { if (domainValue == null) { return null; } final Map<String, Object> values = new HashMap<>(); values.put(PROVIDER_NAME, domainValue.getName()); values.put(HOST, domainValue.getHost()); values.put(PORT, domainValue.getPort()); values.put(MANAGEMENT_PORT, domainValue.getManagementPort()); values.put(WILDFLY_USER, domainValue.getUser()); values.put(WILDFLY_PASSWORD, domainValue.getPassword()); return new ProviderConfiguration(domainValue.getName(), values); } WildflyProviderConfigConverter(); @Override Class<ProviderConfiguration> getModelType(); @Override Class<WildflyProviderConfig> getDomainType(); @Override WildflyProviderConfig toDomain(ProviderConfiguration modelValue); @Override ProviderConfiguration toModel(WildflyProviderConfig domainValue);  }