SignedPDFConsent extends AbstractSignedPDFDocument { @Override public void setContent(byte[] content, Long consentId) { this.signedPdfConsentContent=content; DomainEventManager.raise(new ConsentSignedEvent(consentId)); }  byte[] getSignedPdfConsentContent(); void setSignedPdfConsentContent(byte[] signedPdfConsentContent); @Override byte[] getContent(); @Override void setContent(byte[] content, Long consentId); Long getId(); void setId(Long id);  }
@Test public void testSetContent_ConsentSignedEvent_Is_Fired() { SignedPDFConsent sut = new SignedPDFConsent(); byte[] content = new byte[] {}; final Long consentId = (Long) 1L; ConsentSignedEventHandler domainEventHandler = new ConsentSignedEventHandler(new ConsentSignedEvent(consentId)); DomainEventManager.registerDomainEventService(new DomainEventServiceImpl()); DomainEventManager.register(domainEventHandler); sut.setContent(content, consentId); assertTrue(domainEventHandler.isEventFired()); }