@POST
    @Path("/trigger")
    @NoAuditEvent("No Audit Event needed") // TODO: do we need audit log here?
    @RequiresPermissions(RestPermissions.DATANODE_MIGRATION)
    @ApiOperation(value = "trigger migration step")
    public Response trigger(@ApiParam(name = "request") @NotNull MigrationStepRequest request) {
        final CurrentStateInformation newState = stateMachine.trigger(request.step(), request.args());
        Response.ResponseBuilder response = newState.hasErrors() ? Response.serverError() : Response.ok();
        return response.entity(newState)
                .build();
    }
@Test
    public void requestReturnsSuccessfulResult() {
        final MigrationStateResource resource = new MigrationStateResource(createStateMachine(), mockHttpHeaders(), journalConfiguration);

        try (Response response = resource.trigger(new MigrationStepRequest(MigrationStep.SELECT_MIGRATION, Map.of()))) {
            assertThat(response.getStatus()).isEqualTo(200);
            assertThat(response.getEntity())
                    .isInstanceOf(CurrentStateInformation.class)
                    .extracting(e -> (CurrentStateInformation) e)
                    .satisfies(entity -> assertThat(entity.hasErrors()).isFalse());
        }
    }