예제 #1
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());
  }
예제 #2
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());
  }
예제 #3
0
 @Test
 public void certificateRetrievalReturnsCert() {
   EntitlementCertificate cert = or.createUeberCertificate(principal, owner.getKey());
   assertNotNull(cert);
 }
예제 #4
0
 @Test(expected = NotFoundException.class)
 public void certificateGenerationRaisesExceptionIfOwnerNotFound() throws Exception {
   or.createUeberCertificate(principal, "non-existant");
 }
예제 #5
0
 @Test
 public void testUeberEntitlementIsGenerated() throws Exception {
   or.createUeberCertificate(principal, owner.getKey());
   assertNotNull(poolCurator.findUeberPool(owner));
 }
예제 #6
0
 @Test
 public void testUeberConsumerIsCreated() throws Exception {
   or.createUeberCertificate(principal, owner.getKey());
   assertNotNull(consumerCurator.findByName(owner, "ueber_cert_consumer"));
 }
예제 #7
0
 @Test
 public void testUeberProductIsCreated() throws Exception {
   or.createUeberCertificate(principal, owner.getKey());
   assertNotNull(productCurator.lookupByName(owner, owner.getKey() + UEBER_PRODUCT));
 }