use of io.qameta.allure.Description in project mule by mulesoft.
the class ObjectStreamingExtensionTestCase method getObjectStreamWithTargetVariable.
@Test
@Description("Stores an object stream in a variable leaving without modifying the original payload")
public void getObjectStreamWithTargetVariable() throws Exception {
CoreEvent event = flowRunner("getStreamWithTarget").keepStreamsOpen().withPayload(data).run();
assertThat(event.getVariables().get(MY_STREAM_VAR).getValue(), is(instanceOf(CursorIteratorProvider.class)));
assertThat(IteratorUtils.toList(((CursorIteratorProvider) event.getVariables().get(MY_STREAM_VAR).getValue()).openCursor()), equalTo(data));
assertThat(event.getMessage().getPayload().getValue(), is(instanceOf(List.class)));
assertThat(event.getMessage().getPayload().getValue(), equalTo(data));
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ExtensionsClientTestCase method executeOperationWithComplexType.
@Test
@Description("Executes an operation with a complex type parameter using the client and the DefaultOperationParametersBuilder")
public void executeOperationWithComplexType() throws Throwable {
Weapon.WeaponAttributes attributes = new Weapon.WeaponAttributes();
attributes.setBrand("brand");
OperationParameters params = builder().configName(HEISENBERG_CONFIG).addParameter("weapon", Ricin.class, builder().addParameter("destination", KnockeableDoor.class, builder().addParameter("address", "ADdresss").addParameter("victim", "victim!1231")).addParameter("microgramsPerKilo", 123L)).addParameter("type", FIRE_WEAPON).addParameter("attributesOfWeapon", attributes).build();
Result<String, Object> result = doExecute(HEISENBERG_EXT_NAME, "killWithWeapon", params);
assertThat(result.getOutput(), is("Killed with: You have been killed with Ricin , Type FIRE_WEAPON and attribute brand"));
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ExtensionsClientTestCase method nonExistentExtension.
@Test
@Description("Tries to execute an operation from an extension that does not exist")
public void nonExistentExtension() throws Throwable {
exception.expect(MuleRuntimeException.class);
exception.expectMessage("No Extension [no-exist] Found");
OperationParameters params = builder().configName("config").build();
doExecute("no-exist", "operation", params);
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ExtensionsClientTestCase method executeSimpleOperation.
@Test
@Description("Executes a simple operation using the client and checks the output")
public void executeSimpleOperation() throws Throwable {
OperationParameters params = builder().configName(HEISENBERG_CONFIG).addParameter("victim", "Juani").addParameter("goodbyeMessage", "ADIOS").build();
Result<String, Object> result = doExecute(HEISENBERG_EXT_NAME, "kill", params);
assertThat(result.getOutput(), is("ADIOS, Juani"));
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ExtensionsClientTestCase method executeOperationWithDefaultValueParameter.
@Test
@Description("Executes an operation that has a parameter with default value using the client and checks the output")
public void executeOperationWithDefaultValueParameter() throws Throwable {
OperationParameters params = builder().configName("apple").build();
Result<Collection<?>, Object> result = doExecute(VEGAN, "tryToEatThisListOfMaps", params);
assertThat(result.getOutput(), instanceOf(List.class));
assertThat(result.getOutput(), hasSize(0));
}
Aggregations