AgentResource { @GET @Produces(MediaType.APPLICATION_JSON) public Response getAllSlotsStatus() { AgentStatus agentStatus = agent.getAgentStatus(); AgentStatusRepresentation agentStatusRepresentation = AgentStatusRepresentation.from(agentStatus); return Response.ok(agentStatusRepresentation) .header(AIRSHIP_AGENT_VERSION_HEADER, agentStatus.getVersion()) .build(); } @Inject  AgentResource(Agent agent); @GET @Produces(MediaType.APPLICATION_JSON) Response getAllSlotsStatus();  }
@Test public void testGetAllSlotsStatus() { Response response = agentResource.getAllSlotsStatus(); AgentStatusRepresentation actual = (AgentStatusRepresentation) response.getEntity(); assertEquals(actual.getAgentId(), agent.getAgentId()); assertEquals(actual.getState(), ONLINE); assertEquals(actual.getInstanceType(), null); assertEquals(actual.getResources(), TEST_RESOURCES); assertEquals(actual.getLocation(), agent.getLocation()); }