use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class MessageContextTestCase method assignToMessage.
@Test
public void assignToMessage() throws Exception {
CoreEvent event = CoreEvent.builder(context).message(Message.of("")).build();
assertImmutableVariable("message='foo'", event);
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class VariablesTestCase method localVariable.
@Test
public void localVariable() throws Exception {
Message message = of("");
CoreEvent event = InternalEvent.builder(context).message(message).build();
assertEquals("bar", evaluate("localVar='bar';localVar", event));
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class VariablesTestCase method updateVariableFromFlowScope.
@Test
public void updateVariableFromFlowScope() throws Exception {
Message message = of("");
CoreEvent event = InternalEvent.builder(context).message(message).addVariable("foo", "bar").build();
assertEquals("bar_new", evaluate("foo='bar_new'", event));
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class VariablesTestCase method assignValueToNewSessionVariable.
@Test
public void assignValueToNewSessionVariable() throws Exception {
Message message = of("");
CoreEvent event = InternalEvent.builder(context).message(message).build();
evaluate("sessionVars['foo']='bar'", event);
assertEquals("bar", ((PrivilegedEvent) event).getSession().getProperty("foo"));
}
use of org.mule.runtime.core.api.event.CoreEvent in project mule by mulesoft.
the class VariablesTestCase method reassignValueToLocalVariable.
/**
* See MULE-6381
*/
@Test
public void reassignValueToLocalVariable() throws Exception {
Message message = of("");
CoreEvent event = InternalEvent.builder(context).message(message).build();
evaluate("localVar='bar';localVar='bar2'", event);
}
Aggregations