demo.org.powermock.examples.tutorial.domainmocking.impl
Class SampleServiceImpl
java.lang.Object
demo.org.powermock.examples.tutorial.domainmocking.impl.SampleServiceImpl
- All Implemented Interfaces:
- SampleService
public class SampleServiceImpl
- extends Object
- implements SampleService
This is a simple service that delegates calls to two stub services. The
purpose of this service is to demonstrate that need to mock instantiation of
domain objects.
Method Summary |
boolean |
createPerson(String firstName,
String lastName)
Create a new person based on the following parameters and store it in the
underlying persistence store. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SampleServiceImpl
public SampleServiceImpl(PersonService personService,
EventService eventService)
- Creates a new instance of the SampleServiceImpl with the following
collaborators.
- Parameters:
personService
- The person service to use.eventService
- The event service to use.
createPerson
public boolean createPerson(String firstName,
String lastName)
- Create a new person based on the following parameters and store it in the
underlying persistence store. The service will notify the result of the
operation to an event service.
- Specified by:
createPerson
in interface SampleService
- Parameters:
firstName
- The first name of the person to create.lastName
- The last name of the person to create.
- Returns:
true
if the person was created successfully,
false
otherwise.
Copyright © 2007-2012. All Rights Reserved.