use of org.mule.runtime.api.value.Value in project mule by mulesoft.
the class SourcesValuesTestCase method multiLevelValue.
@Test
public void multiLevelValue() throws Exception {
Set<Value> values = getValuesFromSource("source-with-multi-level-value", "values");
ValueMatcher americaValue = valueWithId("America").withDisplayName("America").withPartName("continent").withChilds(valueWithId("Argentina").withDisplayName("Argentina").withPartName("country").withChilds(valueWithId("Buenos Aires").withDisplayName("Buenos Aires").withPartName("city")));
assertThat(values, hasValues(americaValue));
}
use of org.mule.runtime.api.value.Value in project mule by mulesoft.
the class ValueProviderMediator method resolveValues.
private Set<Value> resolveValues(List<ParameterModel> parameters, ValueProviderFactoryModelProperty factoryModelProperty, ParameterValueResolver parameterValueResolver, Supplier<Object> connectionSupplier, Supplier<Object> configurationSupplier) throws NoSuchMethodException, InstantiationException, IllegalAccessException, java.lang.reflect.InvocationTargetException, InitialisationException, org.mule.runtime.module.extension.internal.runtime.ValueResolvingException, ValueResolvingException {
ValueProvider valueProvider = factoryModelProperty.createFactory(parameterValueResolver, connectionSupplier, configurationSupplier, reflectionCache.get(), muleContext.get()).createValueProvider();
Set<Value> valueSet = valueProvider.resolve();
return valueSet.stream().map(option -> cloneAndEnrichValue(option, parameters)).map(ValueBuilder::build).collect(toSet());
}
use of org.mule.runtime.api.value.Value in project mule by mulesoft.
the class OperationValuesTestCase method multiLevelOption.
@Test
public void multiLevelOption() throws Exception {
Set<Value> values = getValues("multiLevelValue", "values");
ValueMatcher americaValue = valueWithId("America").withDisplayName("America").withPartName("continent").withChilds(valueWithId("Argentina").withDisplayName("Argentina").withPartName("country").withChilds(valueWithId("Buenos Aires").withDisplayName("Buenos Aires").withPartName("city")));
assertThat(values, hasValues(americaValue));
}
Aggregations