use of org.candlepin.dto.api.v1.ProductCertificateDTO in project candlepin by candlepin.
the class OwnerProductResourceTest method getProductCertificate.
@Test
public void getProductCertificate() {
Owner owner = this.createOwner("Example-Corporation");
Product entity = this.createProduct("123", "AwesomeOS Core", owner);
// ensure we check SecurityHole
securityInterceptor.enable();
ProductCertificate cert = new ProductCertificate();
cert.setCert("some text");
cert.setKey("some key");
cert.setProduct(entity);
productCertificateCurator.create(cert);
ProductCertificateDTO cert1 = ownerProductResource.getProductCertificate(owner.getKey(), entity.getId());
ProductCertificateDTO expected = this.modelTranslator.translate(cert, ProductCertificateDTO.class);
assertEquals(cert1, expected);
}
use of org.candlepin.dto.api.v1.ProductCertificateDTO in project candlepin by candlepin.
the class ProductResourceTest method getProductCertificate.
@Test
public void getProductCertificate() {
Owner owner = this.createOwner("Example-Corporation");
Product entity = this.createProduct(owner);
// ensure we check SecurityHole
securityInterceptor.enable();
ProductCertificate cert = new ProductCertificate();
cert.setCert("some text");
cert.setKey("some key");
cert.setProduct(entity);
productCertificateCurator.create(cert);
ProductCertificateDTO cert1 = productResource.getProductCertificate(entity.getUuid());
ProductCertificateDTO expected = this.modelTranslator.translate(cert, ProductCertificateDTO.class);
assertEquals(cert1, expected);
}
Aggregations