Search in sources :

Example 11 with OperationParameters

use of org.mule.runtime.extension.api.client.OperationParameters 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));
}
Also used : OperationParameters(org.mule.runtime.extension.api.client.OperationParameters) Collection(java.util.Collection) Collections.emptyList(java.util.Collections.emptyList) List(java.util.List) Description(io.qameta.allure.Description) Test(org.junit.Test)

Example 12 with OperationParameters

use of org.mule.runtime.extension.api.client.OperationParameters in project mule by mulesoft.

the class ExtensionsClientTestCase method nonExistentConfiguration.

@Test
@Description("Tries to execute an operation with a configuration that does not exist")
public void nonExistentConfiguration() throws Throwable {
    exception.expect(MuleRuntimeException.class);
    exception.expectMessage("No configuration [configDontExist] found");
    OperationParameters params = builder().configName("configDontExist").build();
    doExecute(VEGAN, "applyPolicy", params);
}
Also used : OperationParameters(org.mule.runtime.extension.api.client.OperationParameters) Description(io.qameta.allure.Description) Test(org.junit.Test)

Aggregations

Description (io.qameta.allure.Description)12 Test (org.junit.Test)12 OperationParameters (org.mule.runtime.extension.api.client.OperationParameters)12 Collection (java.util.Collection)1 Collections.emptyList (java.util.Collections.emptyList)1 List (java.util.List)1 ConnectionException (org.mule.runtime.api.connection.ConnectionException)1 KnockeableDoor (org.mule.test.heisenberg.extension.model.KnockeableDoor)1 Ricin (org.mule.test.heisenberg.extension.model.Ricin)1 Weapon (org.mule.test.heisenberg.extension.model.Weapon)1 IntegerAttributes (org.mule.test.heisenberg.extension.model.types.IntegerAttributes)1 VeganPolicy (org.mule.test.vegan.extension.VeganPolicy)1