@Test
public void shouldGetTheActionNameOfAnEnvelope() throws Exception {

    final String actionName = "example.an-action";
    final JsonEnvelope jsonEnvelope = mock(JsonEnvelope.class);
    final Metadata metadata = mock(Metadata.class);
    when(jsonEnvelope.metadata()).thenReturn(metadata);
    when(metadata.name()).thenReturn(actionName);
    assertThat(envelopeInspector.getActionNameFor(jsonEnvelope), is(actionName));
}