LoadBalancerResource { @GET @ApiOperation("Find the load balancer(s) with the specified ID") @Path("/{jobId}") public GetJobLoadBalancersResult getJobLoadBalancers(@PathParam("jobId") String jobId) { return Responses.fromSingleValueObservable( loadBalancerService.getLoadBalancers(JobId.newBuilder().setId(jobId).build(), resolveCallMetadata()) ); } @Inject  LoadBalancerResource(LoadBalancerService loadBalancerService,
                                SystemLogService systemLog,
                                CallMetadataResolver callMetadataResolver); @GET @ApiOperation("Find the load balancer(s) with the specified ID") @Path("/{jobId}") GetJobLoadBalancersResult getJobLoadBalancers(@PathParam("jobId") String jobId); @GET @ApiOperation("Get all load balancers") GetAllLoadBalancersResult getAllLoadBalancers(@Context UriInfo info); @POST @ApiOperation("Add a load balancer") Response addLoadBalancer(
            @QueryParam("jobId") String jobId,
            @QueryParam("loadBalancerId") String loadBalancerId); @DELETE @ApiOperation("Remove a load balancer") Response removeLoadBalancer(
            @QueryParam("jobId") String jobId,
            @QueryParam("loadBalancerId") String loadBalancerId);  }
@Test public void getJobLoadBalancersTest() { GetJobLoadBalancersResult expectedResult = GetJobLoadBalancersResult.newBuilder().build(); when(loadBalancerService.getLoadBalancers(any(), any())).thenReturn(Observable.just(expectedResult)); GetJobLoadBalancersResult actualResult = loadBalancerResource.getJobLoadBalancers(TEST_JOB_ID); assertEquals(expectedResult, actualResult); }