Search in sources :

Example 6 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class DefaultExpressionManagerMelDefaultTestCase method parse.

@Test
@Description("Verifies that parsing works for plain String scenarios.")
public void parse() throws MuleException {
    String expression = "this is a test";
    assertThat(expressionManager.parse(expression, testEvent(), TEST_CONNECTOR_LOCATION), is(expression));
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) Description(io.qameta.allure.Description) Test(org.junit.Test)

Example 7 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class DefaultExpressionManagerMelDefaultTestCase method map.

@Test
@Description("Verifies that a map expression is successful.")
public void map() {
    String expression = "{\'name\' : \'Sarah\', \'surname\' : \'Manning\'}";
    Object result = expressionManager.evaluate(expression).getValue();
    assertThat(result, is(instanceOf(Map.class)));
    assertThat((Map<String, String>) result, hasEntry("name", "Sarah"));
    assertThat((Map<String, String>) result, hasEntry("surname", "Manning"));
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) Description(io.qameta.allure.Description) Test(org.junit.Test)

Example 8 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class DefaultExpressionManagerMelDefaultTestCase method simple.

@Test
@Description("Verifies that a simple literal expression is successful.")
public void simple() {
    String expression = "\"wow\"";
    assertString(expression);
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) Description(io.qameta.allure.Description) Test(org.junit.Test)

Example 9 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class DefaultExpressionManagerMelDefaultTestCase method transformation.

@Test
@Description("Verifies that a simple transformation works. MVEL ignores expectedDataType")
public void transformation() throws MuleException {
    String expression = "payload";
    TypedValue result = expressionManager.evaluate(expression, BYTE_ARRAY, builder().build(), testEvent());
    assertThat(result.getValue(), is(TEST_PAYLOAD));
    assertThat(result.getDataType(), is(STRING));
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) TypedValue(org.mule.runtime.api.metadata.TypedValue) Description(io.qameta.allure.Description) Test(org.junit.Test)

Example 10 with Description

use of io.qameta.allure.Description in project mule by mulesoft.

the class DefaultExpressionManagerMelDefaultTestCase method transformationNotNeeded.

@Test
@Description("Verifies that a simple transformation works even when it's not required.")
public void transformationNotNeeded() throws MuleException {
    String expression = "payload";
    TypedValue result = expressionManager.evaluate(expression, STRING, builder().build(), testEvent());
    assertThat(result.getValue(), is(TEST_PAYLOAD));
    assertThat(result.getDataType(), is(STRING));
}
Also used : Matchers.containsString(org.hamcrest.Matchers.containsString) TypedValue(org.mule.runtime.api.metadata.TypedValue) Description(io.qameta.allure.Description) Test(org.junit.Test)

Aggregations

Description (io.qameta.allure.Description)123 Test (org.junit.Test)111 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)41 Matchers.containsString (org.hamcrest.Matchers.containsString)15 Message (org.mule.runtime.api.message.Message)13 TypedValue (org.mule.runtime.api.metadata.TypedValue)13 RoutingPair (org.mule.runtime.core.internal.routing.ForkJoinStrategy.RoutingPair)12 MessageProcessorChain (org.mule.runtime.core.privileged.processor.chain.MessageProcessorChain)12 OperationParameters (org.mule.runtime.extension.api.client.OperationParameters)12 Issue (io.qameta.allure.Issue)10 Matchers.anyString (org.mockito.Matchers.anyString)8 List (java.util.List)7 MavenConfiguration (org.mule.maven.client.api.model.MavenConfiguration)7 Processor (org.mule.runtime.core.api.processor.Processor)7 PlainCommand (com.axibase.tsd.api.model.command.PlainCommand)6 PropertyCommand (com.axibase.tsd.api.model.command.PropertyCommand)6 Property (com.axibase.tsd.api.model.property.Property)6 RemoteRepository (org.mule.maven.client.api.model.RemoteRepository)6 Event (org.mule.runtime.api.event.Event)6 ReactiveProcessor (org.mule.runtime.core.api.processor.ReactiveProcessor)6