builder.execute();
Assert.assertEquals(builder.testCase().getActions().size(), 1);
Assert.assertEquals(builder.testCase().getActions().get(0).getClass(), ReceiveMessageAction.class);
ReceiveMessageAction action = ((ReceiveMessageAction)builder.testCase().getActions().get(0));
Assert.assertEquals(action.getName(), "receive");
Assert.assertEquals(action.getMessageType(), MessageType.XML.name());
Assert.assertEquals(action.getEndpoint(), messageEndpoint);
Assert.assertEquals(action.getValidationContexts().size(), 1);
Assert.assertEquals(action.getValidationContexts().get(0).getClass(), XmlMessageValidationContext.class);
XmlMessageValidationContext validationContext = (XmlMessageValidationContext) action.getValidationContexts().get(0);
Assert.assertTrue(validationContext.getMessageBuilder() instanceof StaticMessageContentBuilder);
Assert.assertEquals(((StaticMessageContentBuilder)validationContext.getMessageBuilder()).getMessage().getPayload(), "Foo");
Assert.assertNotNull(((StaticMessageContentBuilder)validationContext.getMessageBuilder()).getMessage().getHeader("operation"));
}