use of org.candlepin.model.CertificateSerialCurator in project candlepin by candlepin.
the class CertificateSerialResourceTest method getSerial.
@Test
public void getSerial() {
CertificateSerialCurator csc = mock(CertificateSerialCurator.class);
CertificateSerialResource csr = new CertificateSerialResource(csc, this.modelTranslator);
CertificateSerial cs = new CertificateSerial(10L);
when(csc.find(cs.getId())).thenReturn(cs);
CertificateSerialDTO output = csr.getCertificateSerial(10L);
assertNotNull(output);
CertificateSerialDTO dto = this.modelTranslator.translate(cs, CertificateSerialDTO.class);
assertEquals(dto, output);
}
use of org.candlepin.model.CertificateSerialCurator in project candlepin by candlepin.
the class CertificateSerialResourceTest method listall.
@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();
}
Aggregations