@Test(expected = PreparedCommandTransportException.class)
public void testOnEventWhenPostIsNot2xx() {

    // Setup
    final OutboundCommandPrepared event = mock(OutboundCommandPrepared.class);
    final CommandMeta meta = mock(CommandMeta.class);
    final OutboundCommand command = mock(OutboundCommand.class);
    CommandTransporterStrategy strategy = mock(CommandTransporterStrategy.class);  
    when(clientStrategy.get()).thenReturn(strategy);
    final ResponseEntity entity = mock(ResponseEntity.class);
    CommonSetup(event, meta, command);
    when(strategy.transportPrepareCommand(any())).thenReturn(false);
    when(mockRestTemplate.exchange(anyString(), any(), any(), same(TransporterCommand.class))).thenReturn(entity);
    when(entity.getStatusCode()).thenReturn(HttpStatus.INTERNAL_SERVER_ERROR);
    // Run the test
    prepareRestCommandTransporter.onEvent(event);
    // Verify the results
    verifyTheCommonResults(command);
    verify(mockCommandOrchestrator, never()).receive(any(OutboundCommand.class));
}