@Test
public void shouldValidateARequestEnvelope() throws Exception {

    final String actionName = "example.action-name";
    final JsonEnvelope jsonEnvelope = mock(JsonEnvelope.class);
    final MediaType mediaType = mock(MediaType.class);
    when(envelopeInspector.getActionNameFor(jsonEnvelope)).thenReturn(actionName);
    when(nameToMediaTypeConverter.convert(actionName)).thenReturn(mediaType);
    requestResponseEnvelopeValidator.validateRequest(jsonEnvelope);
    verify(envelopeValidator).validate(jsonEnvelope, actionName, of(mediaType));
}