ErrorEventBuilder implements EventBuilder { void setContextHelper(ContextEventHelper helper) { this.helper = helper; }  @Override void createNewEvent(); @Override void buildDescription(); @Override void buildMessageID(); @Override void buildTransactionID(); @Override Event getEvent(); void setThrowable(Throwable t); @Override void setAssertion(AssertionType assertion); void setInvoker(String invoker); void setMethod(String method); void setService(String service); void setVersion(String version);  }
@Test public void eventWithoutThrowable() throws JSONException { ContextEventHelper helper = mock(ContextEventHelper.class); AssertionType assertion = new AssertionType(); assertion.setMessageId("messageId"); builder.setContextHelper(helper); when(helper.getMessageId(assertion)).thenReturn("messageId"); when(helper.getTransactionId()).thenReturn("transactionId"); Event event = EventDirector.constructEvent(builder); assertNotNull(event); JSONAssert.assertEquals("{}", event.getDescription(), true); assertEquals(MessageProcessingFailedEvent.EVENT_NAME, event.getEventName()); }