@Test public void getReassignment_nonExistingPartition_throwsNotFound() { expect(reassignmentManager.getReassignment(CLUSTER_ID, TOPIC_1, 1)) .andReturn(failedFuture(new NotFoundException())); replay(reassignmentManager); FakeAsyncResponse response = new FakeAsyncResponse(); getReassignmentAction.getReassignment(response, CLUSTER_ID, "topic-1", 1); assertEquals(NotFoundException.class, response.getException().getClass()); }
@GET @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.partitions.reassignment.get") public void getReassignment( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("partitionId") Integer partitionId) { CompletableFuture<GetReassignmentResponse> response = reassignmentManager.get().getReassignment(clusterId, topicName, partitionId) .thenApply(reassignment -> reassignment.orElseThrow(NotFoundException::new)) .thenApply( reassignment -> GetReassignmentResponse.create(toReassignmentData(reassignment))); AsyncResponses.asyncResume(asyncResponse, response); }
GetReassignmentAction { @GET @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.partitions.reassignment.get") public void getReassignment( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("partitionId") Integer partitionId) { CompletableFuture<GetReassignmentResponse> response = reassignmentManager.get().getReassignment(clusterId, topicName, partitionId) .thenApply(reassignment -> reassignment.orElseThrow(NotFoundException::new)) .thenApply( reassignment -> GetReassignmentResponse.create(toReassignmentData(reassignment))); AsyncResponses.asyncResume(asyncResponse, response); } }
GetReassignmentAction { @GET @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.partitions.reassignment.get") public void getReassignment( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("partitionId") Integer partitionId) { CompletableFuture<GetReassignmentResponse> response = reassignmentManager.get().getReassignment(clusterId, topicName, partitionId) .thenApply(reassignment -> reassignment.orElseThrow(NotFoundException::new)) .thenApply( reassignment -> GetReassignmentResponse.create(toReassignmentData(reassignment))); AsyncResponses.asyncResume(asyncResponse, response); } @Inject  GetReassignmentAction(
      Provider<ReassignmentManager> reassignmentManager,
      CrnFactory crnFactory,
      UrlFactory urlFactory); }
GetReassignmentAction { @GET @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.partitions.reassignment.get") public void getReassignment( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("partitionId") Integer partitionId) { CompletableFuture<GetReassignmentResponse> response = reassignmentManager.get().getReassignment(clusterId, topicName, partitionId) .thenApply(reassignment -> reassignment.orElseThrow(NotFoundException::new)) .thenApply( reassignment -> GetReassignmentResponse.create(toReassignmentData(reassignment))); AsyncResponses.asyncResume(asyncResponse, response); } @Inject  GetReassignmentAction(
      Provider<ReassignmentManager> reassignmentManager,
      CrnFactory crnFactory,
      UrlFactory urlFactory); @GET @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.partitions.reassignment.get") void getReassignment(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @PathParam("partitionId") Integer partitionId); }
GetReassignmentAction { @GET @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.partitions.reassignment.get") public void getReassignment( @Suspended AsyncResponse asyncResponse, @PathParam("clusterId") String clusterId, @PathParam("topicName") String topicName, @PathParam("partitionId") Integer partitionId) { CompletableFuture<GetReassignmentResponse> response = reassignmentManager.get().getReassignment(clusterId, topicName, partitionId) .thenApply(reassignment -> reassignment.orElseThrow(NotFoundException::new)) .thenApply( reassignment -> GetReassignmentResponse.create(toReassignmentData(reassignment))); AsyncResponses.asyncResume(asyncResponse, response); } @Inject  GetReassignmentAction(
      Provider<ReassignmentManager> reassignmentManager,
      CrnFactory crnFactory,
      UrlFactory urlFactory); @GET @Produces(MediaType.APPLICATION_JSON) @PerformanceMetric("v3.topics.partitions.reassignment.get") void getReassignment(
      @Suspended AsyncResponse asyncResponse,
      @PathParam("clusterId") String clusterId,
      @PathParam("topicName") String topicName,
      @PathParam("partitionId") Integer partitionId);  }