@Test public void invoke_applier_method() throws InvocationTargetException { final ValidApplier applierObject = new ValidApplier(); final EventApplierMethod applier = new EventApplierMethod(applierObject.getMethod()); final ProjectCreated event = Given.EventMessage.projectCreated(); applier.invoke(applierObject, event); assertEquals(event, applierObject.eventApplied); }
@Test @SuppressWarnings("deprecation") public void have_deprecated_invoke_method_with_context() throws InvocationTargetException { final ValidApplier applierObject = new ValidApplier(); final EventApplierMethod applier = new EventApplierMethod(applierObject.getMethod()); final ProjectCreated event = Given.EventMessage.projectCreated(); applier.invoke(applierObject, event, Empty.getDefaultInstance()); assertEquals(event, applierObject.eventApplied); }