use of io.qameta.allure.Description in project mule by mulesoft.
the class ExtensionsClientTestCase method executeVoidOperation.
@Test
@Description("Executes a void operation using the client")
public void executeVoidOperation() throws Throwable {
OperationParameters params = builder().configName(HEISENBERG_CONFIG).build();
Result<Object, Object> result = doExecute(HEISENBERG_EXT_NAME, "die", params);
assertThat(result.getOutput(), is(nullValue()));
assertThat(result.getAttributes().isPresent(), is(false));
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ExtensionsClientTestCase method executeOperationWithParameterGroup.
@Test
@Description("Executes an operation that has a parameter group using the client and checks the output")
public void executeOperationWithParameterGroup() throws Throwable {
OperationParameters params = builder().configName(HEISENBERG_CONFIG).addParameter("greeting", "jeje").addParameter("age", 23).addParameter("name", "Juani").addParameter("knownAddresses", emptyList()).build();
Result<String, Object> result = doExecute(HEISENBERG_EXT_NAME, "alias", params);
assertThat(result.getOutput(), is(ALIAS_OUTPUT));
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ExtensionsClientTestCase method nonExistentOperation.
@Test
@Description("Tries to execute an operation that does not exist")
public void nonExistentOperation() throws Throwable {
exception.expect(MuleRuntimeException.class);
exception.expectMessage("No Operation [operationDontExist] Found");
OperationParameters params = builder().configName("config").build();
doExecute(VEGAN, "operationDontExist", params);
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class DirectProcessingStrategyTestCase method tx.
@Override
@Description("Regardless of processor type, when the DirectProcessingStrategy is configured, the pipeline is executed " + "synchronously in a caller thread.")
public void tx() throws Exception {
flow = flowBuilder.get().processors(cpuLightProcessor, cpuIntensiveProcessor, blockingProcessor).build();
flow.initialise();
flow.start();
TransactionCoordination.getInstance().bindTransaction(new TestTransaction(muleContext));
processFlow(testEvent());
assertSynchronous(1);
}
use of io.qameta.allure.Description in project mule by mulesoft.
the class ProactorStreamProcessingStrategyTestCase method cpuIntensiveRejectedExecution.
@Test
@Description("If CPU INTENSIVE pool is busy OVERLOAD error is thrown")
public void cpuIntensiveRejectedExecution() throws Exception {
Scheduler cpuIntensiveSchedulerSpy = spy(cpuIntensive);
Scheduler rejectingSchedulerSpy = spy(new RejectingScheduler(cpuIntensiveSchedulerSpy));
flow = flowBuilder.get().processors(cpuIntensiveProcessor).processingStrategyFactory((context, prefix) -> new ProactorStreamProcessingStrategy(() -> ringBuffer, DEFAULT_BUFFER_SIZE, 1, DEFAULT_WAIT_STRATEGY, () -> cpuLight, () -> blocking, () -> rejectingSchedulerSpy, 1, 2)).build();
flow.initialise();
flow.start();
processFlow(testEvent());
verify(rejectingSchedulerSpy, times(11)).submit(any(Callable.class));
verify(cpuIntensiveSchedulerSpy, times(1)).submit(any(Callable.class));
assertThat(threads, hasSize(1));
assertThat(threads.stream().filter(name -> name.startsWith(CPU_INTENSIVE)).count(), equalTo(1l));
assertThat(threads, not(hasItem(startsWith(CPU_LIGHT))));
assertThat(threads, not(hasItem(startsWith(IO))));
assertThat(threads, not(hasItem(startsWith(CUSTOM))));
}
Aggregations