MockEndpoint mockInMessageEnd = getMockEndpoint("mock:result-in-message-name");
mockInMessageEnd.expectedMessageCount(0);
MockEndpoint mockErrorChannel = getMockEndpoint("mock:in-message-name-error");
mockErrorChannel.expectedMessageCount(1);
Key key = Key.newBuilder().setKey("1").build();
Value value = Value.newBuilder().setValue("test value").build();
Object[] request = {key, value};
template.sendBodyAndHeader("direct:in-message-name", request, AvroConstants.AVRO_MESSAGE_NAME, "/get");
mockErrorChannel.assertIsSatisfied(5000);
mockInMessageEnd.assertIsSatisfied();
}