@Test public final void testPersist() throws Exception { final Person testPerson = context.mock(Person.class); final StreamScope streamScope = context.mock(StreamScope.class); context.checking(new Expectations() { { oneOf(personMapperMock).insert(testPerson); exactly(3).of(testPerson).getId(); will(returnValue(2L)); oneOf(personMapperMock).addFollower(2L, 2L); oneOf(testPerson).getStreamScope(); will(returnValue(streamScope)); oneOf(streamScope).setDestinationEntityId(2L); } }); sut.persist(null, null, testPerson); context.assertIsSatisfied(); }
@Override public void persist(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields, final Person inPerson) throws Exception { personMapper.insert(inPerson); inPerson.getStreamScope().setDestinationEntityId(inPerson.getId()); personMapper.addFollower(inPerson.getId(), inPerson.getId()); }
PersonCreator implements ResourcePersistenceStrategy<Person> { @Override public void persist(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields, final Person inPerson) throws Exception { personMapper.insert(inPerson); inPerson.getStreamScope().setDestinationEntityId(inPerson.getId()); personMapper.addFollower(inPerson.getId(), inPerson.getId()); } }
PersonCreator implements ResourcePersistenceStrategy<Person> { @Override public void persist(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields, final Person inPerson) throws Exception { personMapper.insert(inPerson); inPerson.getStreamScope().setDestinationEntityId(inPerson.getId()); personMapper.addFollower(inPerson.getId(), inPerson.getId()); } PersonCreator(final PersonMapper inPersonMapper,
            final DomainMapper<Long, List<Stream>> inReadonlyStreamsMapper, //
            final List<String> inReadOnlyStreamsNameList, final PersonPropertiesGenerator inPersonPropertiesGenerator); }
PersonCreator implements ResourcePersistenceStrategy<Person> { @Override public void persist(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields, final Person inPerson) throws Exception { personMapper.insert(inPerson); inPerson.getStreamScope().setDestinationEntityId(inPerson.getId()); personMapper.addFollower(inPerson.getId(), inPerson.getId()); } PersonCreator(final PersonMapper inPersonMapper,
            final DomainMapper<Long, List<Stream>> inReadonlyStreamsMapper, //
            final List<String> inReadOnlyStreamsNameList, final PersonPropertiesGenerator inPersonPropertiesGenerator); @Override Person get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields); @Override void persist(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields, final Person inPerson); }
PersonCreator implements ResourcePersistenceStrategy<Person> { @Override public void persist(final TaskHandlerActionContext<PrincipalActionContext> inActionContext, final Map<String, Serializable> inFields, final Person inPerson) throws Exception { personMapper.insert(inPerson); inPerson.getStreamScope().setDestinationEntityId(inPerson.getId()); personMapper.addFollower(inPerson.getId(), inPerson.getId()); } PersonCreator(final PersonMapper inPersonMapper,
            final DomainMapper<Long, List<Stream>> inReadonlyStreamsMapper, //
            final List<String> inReadOnlyStreamsNameList, final PersonPropertiesGenerator inPersonPropertiesGenerator); @Override Person get(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields); @Override void persist(final TaskHandlerActionContext<PrincipalActionContext> inActionContext,
            final Map<String, Serializable> inFields, final Person inPerson);  }