GuestIdResource { @ApiOperation(notes = "Retrieves the List of a Consumer's Guests", value = "getGuestIds", response = GuestIdDTO.class, responseContainer = "list") @ApiResponses({ @ApiResponse(code = 400, message = ""), @ApiResponse(code = 404, message = "") }) @GET @Produces(MediaType.APPLICATION_JSON) public CandlepinQuery<GuestIdDTO> getGuestIds( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid) { Consumer consumer = consumerCurator.findByUuid(consumerUuid); return translator.translateQuery(guestIdCurator.listByConsumer(consumer), GuestIdDTO.class); } @Inject  GuestIdResource(GuestIdCurator guestIdCurator, ConsumerCurator consumerCurator,
        ConsumerTypeCurator consumerTypeCurator, ConsumerResource consumerResource, I18n i18n,
        EventFactory eventFactory, EventSink sink, Provider<GuestMigration> migrationProvider,
        ModelTranslator translator); @ApiOperation(notes = "Retrieves the List of a Consumer's Guests", value = "getGuestIds", response = GuestIdDTO.class, responseContainer = "list") @ApiResponses({ @ApiResponse(code = 400, message = ""), @ApiResponse(code = 404, message = "") }) @GET @Produces(MediaType.APPLICATION_JSON) CandlepinQuery<GuestIdDTO> getGuestIds(
        @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid); @ApiOperation(notes = "Retrieves a single Guest By its consumer and the guest UUID", value = "getGuestId") @GET @Produces(MediaType.APPLICATION_JSON) @Path("/{guest_id}") GuestIdDTO getGuestId(
        @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid,
        @PathParam("guest_id") String guestId); @ApiOperation(notes = "Updates the List of Guests on a Consumer This method should work " + "just like updating the consumer, except that it only updates GuestIds. " + " Eventually we should move All the logic here, and depricate updating guests " + "through the consumer update.", value = "updateGuests") @PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) void updateGuests(
        @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid,
        @ApiParam(name = "guestIds", required = true) List<GuestIdDTO> guestIdDTOs); @ApiOperation(notes = "Updates a single Guest on a Consumer. Allows virt-who to avoid uploading" + " an entire list of guests", value = "updateGuest") @PUT @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) @Path("/{guest_id}") void updateGuest(
        @ApiParam("consumer who owns or hosts the guest in question")
        @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid,
        @ApiParam("guest virtual uuid")
        @PathParam("guest_id") String guestId,
        @ApiParam(name = "updated", required = true, value = "updated guest data to use")
        GuestIdDTO updatedDTO); @ApiOperation(notes = "Removes the Guest from the Consumer", value = "deleteGuest") @DELETE @Produces(MediaType.APPLICATION_JSON) @Path("/{guest_id}") void deleteGuest(
        @ApiParam("consumer who owns or hosts the guest in question")
        @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid,
        @PathParam("guest_id") String guestId,
        @QueryParam("unregister") @DefaultValue("false") boolean unregister,
        @Context Principal principal);  }
@Test public void getGuestIdsEmpty() { CandlepinQuery<GuestId> query = mock(CandlepinQuery.class); CandlepinQuery<GuestIdDTO> dtoQuery = mock(CandlepinQuery.class); when(guestIdCurator.listByConsumer(eq(consumer))).thenReturn(query); when(query.transform((any(ElementTransformer.class)))).thenReturn(dtoQuery); CandlepinQuery<GuestIdDTO> result = guestIdResource.getGuestIds(consumer.getUuid()); verify(query, times(1)).transform(any(ElementTransformer.class)); assertEquals(result, dtoQuery); }