use of org.mule.test.vegan.extension.VeganPolicy in project mule by mulesoft.
the class ExtensionsClientTestCase method executeOperationWithNullSafeParameter.
@Test
@Description("Executes an operation that has a @NullSafe annotated parameter using the client and checks the output")
public void executeOperationWithNullSafeParameter() throws Throwable {
OperationParameters params = builder().configName("banana").build();
Result<VeganPolicy, Object> result = doExecute(VEGAN, "applyPolicy", params);
assertThat(result.getOutput().getMeetAllowed(), is(false));
assertThat(result.getOutput().getIngredients().getSaltMiligrams(), is(0));
}
use of org.mule.test.vegan.extension.VeganPolicy in project mule by mulesoft.
the class NullSafeOnImplicitElementTestCase method nullSafeOnImplicitConnectionProvider.
@Test
public void nullSafeOnImplicitConnectionProvider() throws Exception {
VeganPolicy policy = (VeganPolicy) flowRunner("grape-operation").run().getMessage().getPayload().getValue();
assertThat(policy, is(notNullValue()));
assertThat(policy.getMeetAllowed(), is(false));
assertThat(policy.getMaxCalories(), is(500));
}
use of org.mule.test.vegan.extension.VeganPolicy in project mule by mulesoft.
the class NullSafeParameterTestCase method getNullSafeObject.
@Test
public void getNullSafeObject() throws Exception {
VeganPolicy policy = (VeganPolicy) flowRunner("policy").run().getMessage().getPayload().getValue();
assertThat(policy, is(notNullValue()));
assertThat(policy.getMeetAllowed(), is(false));
assertThat(policy.getIngredients(), is(notNullValue()));
assertThat(policy.getIngredients().getSaltMiligrams(), is(0));
assertThat(policy.getIngredients().getSaltReplacementName(), is(nullValue()));
}
Aggregations