@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()); }
@Test(expected = NotFoundException.class) public void certificateRetrievalRaisesExceptionIfOwnerNotFound() throws Exception { or.getUeberCertificate(principal, "non-existant"); }