@Test void updateStatus_setWritableAndNonReplicating() { final WebClient client = dogma.httpClient(); final AggregatedHttpResponse res = client.execute( RequestHeaders.of(HttpMethod.PATCH, API_V1_PATH_PREFIX + "status", HttpHeaderNames.CONTENT_TYPE, MediaType.JSON_PATCH), "[{ \"op\": \"replace\", \"path\": \"/writable\", \"value\": true }," + " { \"op\": \"replace\", \"path\": \"/replicating\", \"value\": false }]").aggregate().join(); assertThat(res.status()).isEqualTo(HttpStatus.BAD_REQUEST); }
@Get("/status") public ServerStatus status() { return new ServerStatus(executor().isWritable(), executor().isStarted()); }
AdministrativeService extends AbstractService { @Get("/status") public ServerStatus status() { return new ServerStatus(executor().isWritable(), executor().isStarted()); } }
AdministrativeService extends AbstractService { @Get("/status") public ServerStatus status() { return new ServerStatus(executor().isWritable(), executor().isStarted()); } AdministrativeService(ProjectManager projectManager, CommandExecutor executor); }
AdministrativeService extends AbstractService { @Get("/status") public ServerStatus status() { return new ServerStatus(executor().isWritable(), executor().isStarted()); } AdministrativeService(ProjectManager projectManager, CommandExecutor executor); @Get("/status") ServerStatus status(); @Patch("/status") @Consumes("application/json-patch+json") @RequiresAdministrator CompletableFuture<ServerStatus> updateStatus(ServiceRequestContext ctx,
                                                        JsonNode patch); }
AdministrativeService extends AbstractService { @Get("/status") public ServerStatus status() { return new ServerStatus(executor().isWritable(), executor().isStarted()); } AdministrativeService(ProjectManager projectManager, CommandExecutor executor); @Get("/status") ServerStatus status(); @Patch("/status") @Consumes("application/json-patch+json") @RequiresAdministrator CompletableFuture<ServerStatus> updateStatus(ServiceRequestContext ctx,
                                                        JsonNode patch);  }