public EndpointResponse getStatus(final String type, final String entity, final String action) {
    final CommandId commandId = new CommandId(type, entity, action);

    final Optional<CommandStatus> commandStatus = statementExecutor.getStatus(commandId);

    return commandStatus.map(EndpointResponse::ok)
        .orElseGet(() -> Errors.notFound("Command not found"));

  }
@Test
  public void testGetStatus() throws Exception {
    final StatusResource testResource = getTestStatusResource();

    for (final Map.Entry<CommandId, CommandStatus> commandEntry : mockCommandStatuses.entrySet()) {
      final CommandId commandId = commandEntry.getKey();
      final CommandStatus expectedCommandStatus = commandEntry.getValue();

      final Object statusEntity = testResource.getStatus(commandId.getType().name(), commandId.getEntity(), commandId.getAction().name()).getEntity();
      assertThat(statusEntity, instanceOf(CommandStatus.class));
      final CommandStatus testCommandStatus = (CommandStatus) statusEntity;

      assertEquals(expectedCommandStatus, testCommandStatus);
    }
  }