JenaLists implements Lists { @Override public void updateReferencedList(ReferencedListValueDescriptor descriptor) throws OntoDriverException { executeBeforeCallbackAndVerifyArgument(descriptor); adapter.referencedListHandler().updateList(descriptor); afterChangeCallback.execute(); } JenaLists(JenaAdapter adapter, Procedure beforeCallback, Procedure afterChangeCallback); @Override List<Axiom<NamedResource>> loadSimpleList(SimpleListDescriptor descriptor); @Override void persistSimpleList(SimpleListValueDescriptor descriptor); @Override void updateSimpleList(SimpleListValueDescriptor descriptor); @Override List<Axiom<NamedResource>> loadReferencedList(ReferencedListDescriptor descriptor); @Override void persistReferencedList(ReferencedListValueDescriptor descriptor); @Override void updateReferencedList(ReferencedListValueDescriptor descriptor);  }
@Test public void updateReferencedListExecutesBeforeCallbackBeforeReferencedListHandler() throws Exception { final ReferencedListValueDescriptor descriptor = new ReferencedListValueDescriptor(RESOURCE, HAS_LIST, HAS_NEXT, HAS_CONTENT); lists.updateReferencedList(descriptor); final InOrder inOrder = Mockito.inOrder(beforeMock, referencedListHandlerMock); inOrder.verify(beforeMock).execute(); inOrder.verify(referencedListHandlerMock).updateList(descriptor); }
@Test public void updateReferencedListExecutesAfterCallbackAfterReferencedListHandler() throws Exception { final ReferencedListValueDescriptor descriptor = new ReferencedListValueDescriptor(RESOURCE, HAS_LIST, HAS_NEXT, HAS_CONTENT); lists.updateReferencedList(descriptor); final InOrder inOrder = Mockito.inOrder(referencedListHandlerMock, afterMock); inOrder.verify(referencedListHandlerMock).updateList(descriptor); inOrder.verify(afterMock).execute(); }