use of org.guvnor.ala.ui.model.ProviderConfiguration in project kie-wb-common by kiegroup.
the class WildflyProviderConfigConverterTest method testToModel.
@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));
}
use of org.guvnor.ala.ui.model.ProviderConfiguration in project kie-wb-common by kiegroup.
the class WildflyProviderConfigConverterTest method testToDomain.
@Test
public void testToDomain() {
Map<String, Object> values = new HashMap<>();
values.put(HOST, HOST_VALUE);
values.put(PORT, PORT_VALUE);
values.put(MANAGEMENT_PORT, MANAGEMENT_PORT_VALUE);
values.put(WILDFLY_USER, WILDFLY_USER_VALUE);
values.put(WILDFLY_PASSWORD, WILDFLY_PASSWORD_VALUE);
ProviderConfiguration configuration = new ProviderConfiguration(PROVIDER_NAME_VALUE, values);
WildflyProviderConfig result = converter.toDomain(configuration);
assertNotNull(result);
assertEquals(PROVIDER_NAME_VALUE, result.getName());
assertEquals(HOST_VALUE, result.getHost());
assertEquals(PORT_VALUE, result.getPort());
assertEquals(MANAGEMENT_PORT_VALUE, result.getManagementPort());
assertEquals(WILDFLY_USER_VALUE, result.getUser());
assertEquals(WILDFLY_PASSWORD_VALUE, result.getPassword());
}
use of org.guvnor.ala.ui.model.ProviderConfiguration in project kie-wb-common by kiegroup.
the class OpenShiftProviderConfigConverterTest method testToDomain.
@Test
public void testToDomain() {
Map<String, Object> values = new HashMap<>();
values.put(KUBERNETES_MASTER.inputKey(), MASTER_URL_VALUE);
values.put(KUBERNETES_AUTH_BASIC_USERNAME.inputKey(), USER_VALUE);
values.put(KUBERNETES_AUTH_BASIC_PASSWORD.inputKey(), PASSWORD_VALUE);
ProviderConfiguration configuration = new ProviderConfiguration(PROVIDER_NAME_VALUE, values);
OpenShiftProviderConfig result = converter.toDomain(configuration);
assertNotNull(result);
assertEquals(PROVIDER_NAME_VALUE, result.getName());
assertEquals(MASTER_URL_VALUE, result.getKubernetesMaster());
assertEquals(USER_VALUE, result.getKubernetesAuthBasicUsername());
assertEquals(PASSWORD_VALUE, result.getKubernetesAuthBasicPassword());
}
use of org.guvnor.ala.ui.model.ProviderConfiguration in project kie-wb-common by kiegroup.
the class OpenShiftProviderConfigPresenterTest method testBuildProviderConfiguration.
@Test
public void testBuildProviderConfiguration() {
when(view.getProviderName()).thenReturn(PROVIDER_NAME_VALUE);
when(view.getMasterURL()).thenReturn(MASTER_URL_VALUE);
when(view.getUsername()).thenReturn(USER_VALUE);
when(view.getPassword()).thenReturn(PASSWORD_VALUE);
ProviderConfiguration configuration = presenter.buildProviderConfiguration();
assertEquals(PROVIDER_NAME_VALUE, presenter.getProviderName());
assertEquals(MASTER_URL_VALUE, configuration.getValues().get(MASTER_URL));
assertEquals(USER_VALUE, configuration.getValues().get(USER));
assertEquals(PASSWORD_VALUE, configuration.getValues().get(PASSWORD));
}
use of org.guvnor.ala.ui.model.ProviderConfiguration in project kie-wb-common by kiegroup.
the class ProviderServiceImplTest method prepareConfigurationForCreate.
private void prepareConfigurationForCreate() {
providerConfiguration = mock(ProviderConfiguration.class);
Map values = mock(Map.class);
when(values.size()).thenReturn(5);
when(providerConfiguration.getValues()).thenReturn(values);
providerConfig = mock(ProviderConfig.class);
when(providerConfigConverter.toDomain(providerConfiguration)).thenReturn(providerConfig);
}
Aggregations