use of org.mule.runtime.extension.api.runtime.config.ConfigurationState in project mule by mulesoft.
the class ConnectionlessMessageSourceTestCase method obtainDisconnectedSourceConfigParameters.
@Test
public void obtainDisconnectedSourceConfigParameters() throws Exception {
Component element = locator.find(Location.builder().globalName("source").addSourcePart().build()).get();
assertThat(element, is(instanceOf(ConfiguredComponent.class)));
final ConfigurationInstance configurationInstance = ((ConfiguredComponent) element).getConfigurationInstance().get();
ConfigurationState configurationState = configurationInstance.getState();
assertThat(configurationState.getConfigParameters().size(), is(0));
assertThat(configurationState.getConnectionParameters().size(), is(0));
}
use of org.mule.runtime.extension.api.runtime.config.ConfigurationState in project mule by mulesoft.
the class HeisenbergMessageSourceTestCase method obtainSourceConfigParameters.
@Test
public void obtainSourceConfigParameters() throws Exception {
Component element = locator.find(Location.builder().globalName("source").addSourcePart().build()).get();
assertThat(element, is(instanceOf(ConfiguredComponent.class)));
ConfiguredComponent source = (ConfiguredComponent) element;
ConfigurationState configurationState = source.getConfigurationInstance().get().getState();
Map<String, Object> configParameters = configurationState.getConfigParameters();
assertThat(configParameters.size(), is(13));
assertParameter(configParameters, "enemies", hasSize(0));
assertParameter(configParameters, "monthlyIncomes", hasSize(2));
assertParameter(configParameters, "cancer", is(true));
assertParameter(configParameters, "money", equalTo(new BigDecimal("0")));
assertParameter(configParameters, "initialHealth", is(CANCER));
assertParameter(configParameters, "endingHealth", is(CANCER));
assertParameter(configParameters, "name", is("Heisenberg"));
assertParameter(configParameters, "age", is(50));
assertParameter(configParameters, "brotherInLaw", is(notNullValue()));
Map<String, Object> connectionParameters = configurationState.getConnectionParameters();
assertThat(connectionParameters.size(), is(2));
assertParameter(connectionParameters, "saulPhoneNumber", equalTo(SAUL_OFFICE_NUMBER));
}
Aggregations