CertificateSerialResource { @ApiOperation(notes = "Retrieves single Certificate Serial", value = "getCertificateSerial") @GET @Path("/{serial_id}") @Produces(MediaType.APPLICATION_JSON) public CertificateSerialDTO getCertificateSerial(@PathParam("serial_id") Long serialId) { CertificateSerial serial = this.certificateSerialCurator.get(serialId); return this.translator.translate(serial, 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 getSerial() { CertificateSerialCurator csc = mock(CertificateSerialCurator.class); CertificateSerialResource csr = new CertificateSerialResource(csc, this.modelTranslator); CertificateSerial cs = new CertificateSerial(10L); when(csc.get(cs.getId())).thenReturn(cs); CertificateSerialDTO output = csr.getCertificateSerial(10L); assertNotNull(output); CertificateSerialDTO dto = this.modelTranslator.translate(cs, CertificateSerialDTO.class); assertEquals(dto, output); }