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