Beispiel #1
0
  @Test(expected = NotFoundException.class)
  public void certificateRetrievalRaisesExceptionIfNoCertificateWasGenerated() throws Exception {
    // generate certificate for one owner
    or.createUeberCertificate(principal, owner.getKey());

    // verify that owner under test doesn't have a certificate
    Owner anotherOwner = ownerCurator.create(new Owner(OWNER_NAME + "1"));
    or.getUeberCertificate(principal, anotherOwner.getKey());
  }
Beispiel #2
0
  @Test
  public void testUeberCertIsRegeneratedOnNextInvocation() throws Exception {
    EntitlementCertificate firstCert = or.createUeberCertificate(principal, owner.getKey());
    Product firstProduct = productCurator.lookupByName(owner, owner.getKey() + UEBER_PRODUCT);

    EntitlementCertificate secondCert = or.createUeberCertificate(principal, owner.getKey());
    Product secondProduct = productCurator.lookupByName(owner, owner.getKey() + UEBER_PRODUCT);

    // make sure we didn't regenerate the whole thing
    assertTrue(firstProduct.getUuid() == secondProduct.getUuid());
    // only the ueber cert
    assertFalse(firstCert.getId() == secondCert.getId());
  }
Beispiel #3
0
 @Test
 public void certificateRetrievalReturnsCert() {
   EntitlementCertificate cert = or.createUeberCertificate(principal, owner.getKey());
   assertNotNull(cert);
 }
Beispiel #4
0
 @Test(expected = NotFoundException.class)
 public void certificateRetrievalRaisesExceptionIfOwnerNotFound() throws Exception {
   or.getUeberCertificate(principal, "non-existant");
 }
Beispiel #5
0
 @Test(expected = NotFoundException.class)
 public void certificateGenerationRaisesExceptionIfOwnerNotFound() throws Exception {
   or.createUeberCertificate(principal, "non-existant");
 }
Beispiel #6
0
 @Test
 public void testUeberEntitlementIsGenerated() throws Exception {
   or.createUeberCertificate(principal, owner.getKey());
   assertNotNull(poolCurator.findUeberPool(owner));
 }
Beispiel #7
0
 @Test
 public void testUeberConsumerIsCreated() throws Exception {
   or.createUeberCertificate(principal, owner.getKey());
   assertNotNull(consumerCurator.findByName(owner, "ueber_cert_consumer"));
 }
Beispiel #8
0
 @Test
 public void testUeberProductIsCreated() throws Exception {
   or.createUeberCertificate(principal, owner.getKey());
   assertNotNull(productCurator.lookupByName(owner, owner.getKey() + UEBER_PRODUCT));
 }