CertificateSerialResource { @ApiOperation(notes = "Retrieves a list of Certificate Serials", value = "getCertificateSerials", response = CertificateSerialDTO.class, responseContainer = "list") @GET @Produces(MediaType.APPLICATION_JSON) public CandlepinQuery<CertificateSerialDTO> getCertificateSerials() { CandlepinQuery<CertificateSerial> query = this.certificateSerialCurator.listAll(); return this.translator.translateQuery(query, CertificateSerialDTO.class); } @Inject  CertificateSerialResource(CertificateSerialCurator certificateSerialCurator,
        ModelTranslator translator); @ApiOperation(notes = "Retrieves a list of Certificate Serials", value = "getCertificateSerials", response = CertificateSerialDTO.class, responseContainer = "list") @GET @Produces(MediaType.APPLICATION_JSON) CandlepinQuery<CertificateSerialDTO> getCertificateSerials(); @ApiOperation(notes = "Retrieves single Certificate Serial", value = "getCertificateSerial") @GET @Path("/{serial_id}") @Produces(MediaType.APPLICATION_JSON) CertificateSerialDTO getCertificateSerial(@PathParam("serial_id") Long serialId);  }
@Test public void listall() { CandlepinQuery cqmock = new EmptyCandlepinQuery(); CertificateSerialCurator csc = mock(CertificateSerialCurator.class); when(csc.listAll()).thenReturn(cqmock); CertificateSerialResource csr = new CertificateSerialResource(csc, this.modelTranslator); CandlepinQuery<CertificateSerialDTO> result = csr.getCertificateSerials(); assertNotNull(result); verify(csc, times(1)).listAll(); }