### Question:
ShardController { @GET @Produces(MediaType.APPLICATION_JSON) @Operation( summary = "Retrieve all completed only shards", description = "Get all 'completed' shard entries from database", tags = {"shards"}, responses = { @ApiResponse(responseCode = "200", description = "Successful execution", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ShardDTO.class))) }) @PermitAll public Response getAllShards() { List<ShardDTO> allCompletedShards = shardService.getAllCompletedShards().stream() .map(shard -> shardConverter.convert(shard)).collect(Collectors.toList()); return Response.ok(allCompletedShards).build(); } @Inject  ShardController(ShardService shardService, FirstLastIndexParser indexParser);  ShardController(); @GET @Produces(MediaType.APPLICATION_JSON) @Operation( summary = "Retrieve all completed only shards", description = "Get all 'completed' shard entries from database", tags = {"shards"}, responses = { @ApiResponse(responseCode = "200", description = "Successful execution", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ShardDTO.class))) }) @PermitAll Response getAllShards(); @POST @Path("/reset/{id}") @Produces(MediaType.APPLICATION_JSON) @Operation( summary = "Reset node to backup db before sharding specified by id", description = "Find backup before shard with specified id and when it exists - we will drop our blockchain and load backup entirely", security = @SecurityRequirement(name = "admin_api_key"), tags = {"shards"} ) @RolesAllowed("admin") Response resetToBackup(@PathParam("id") long shardId); @GET @Path("/blocks") @Produces(MediaType.APPLICATION_JSON) @Operation( summary = "Select full shards containing Blocks requested by 'firstIndex' and 'lastIndex' height range", description = "Select full shards containing Blocks requested by 'firstIndex' and 'lastIndex' height range values." +" Index range is recalculated by default number of blocks to be requested using 'apl.maxAPIRecords' config value", tags = {"shards"}, responses = { @ApiResponse(responseCode = "200", description = "Successful execution", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ShardDTO.class))) } ) @PermitAll Response getBlocksFromShards(
        @Parameter(description = "A zero-based index to the 'first height' to retrieve (optional)." )
        @QueryParam("firstIndex") @DefaultValue("0") @PositiveOrZero int firstIndex,
        @Parameter(description = "A zero-based index to the 'last height' to retrieve (optional)." )
        @QueryParam("lastIndex") @DefaultValue("-1") int lastIndex
    );  }### Answer:
@Test void testGetAllShards() throws URISyntaxException, IOException { doReturn(ShardTestData.SHARDS).when(shardService).getAllCompletedShards(); MockHttpRequest request = MockHttpRequest.get("/shards").contentType(MediaType.APPLICATION_JSON_TYPE); MockHttpResponse response = new MockHttpResponse(); dispatcher.invoke(request, response); assertEquals(200, response.getStatus()); String shardJson = response.getContentAsString(); List<ShardDTO> shards = mapper.readValue(shardJson, new TypeReference<List<ShardDTO>>() { }); assertEquals(ShardTestData.SHARD_DTO_LIST, shards); }