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.getEndpoint(), messageEndpoint);
Assert.assertEquals(action.getMessageType(), MessageType.JSON.name());
Assert.assertEquals(action.getValidator(), validator);
Assert.assertEquals(action.getValidationContexts().size(), 2L);
ScriptValidationContext validationContext = (ScriptValidationContext) action.getValidationContexts().get(0);
Assert.assertEquals(validationContext.getScriptType(), ScriptTypes.GROOVY);
Assert.assertEquals(validationContext.getValidationScript(), "assert true");
Assert.assertNull(validationContext.getValidationScriptResourcePath());
ControlMessageValidationContext headerValidationContext = (ControlMessageValidationContext) action.getValidationContexts().get(1);
Assert.assertTrue(headerValidationContext.getMessageBuilder() instanceof PayloadTemplateMessageBuilder);
Assert.assertNull(((PayloadTemplateMessageBuilder)headerValidationContext.getMessageBuilder()).getPayloadData());
Assert.assertNull(((PayloadTemplateMessageBuilder)headerValidationContext.getMessageBuilder()).getPayloadResourcePath());
Assert.assertTrue(((PayloadTemplateMessageBuilder)headerValidationContext.getMessageBuilder()).getMessageHeaders().containsKey("operation"));