demo.org.powermock.examples.tutorial.partialmocking.service.impl
Class ProviderServiceImpl

java.lang.Object
  extended by demo.org.powermock.examples.tutorial.partialmocking.service.impl.ProviderServiceImpl
All Implemented Interfaces:
ProviderService

public class ProviderServiceImpl
extends Object
implements ProviderService

A simple implementation of the providers service. This is the class that's going to be tested using PowerMock. The main reason for the test is to demonstrate how to use PowerMock to set internal state (i.e. setting the providerDao field without setters), partial mocking and expectations of private methods.


Constructor Summary
ProviderServiceImpl()
           
 
Method Summary
 Set<ServiceProducer> getAllServiceProviders()
          Get all service provider.
 ServiceProducer getServiceProvider(int id)
          Get a service provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProviderServiceImpl

public ProviderServiceImpl()
Method Detail

getAllServiceProviders

public Set<ServiceProducer> getAllServiceProviders()
Get all service provider.

Specified by:
getAllServiceProviders in interface ProviderService
Returns:
All service provider artifacts currently available or an empty set if no service providers are available.

getServiceProvider

public ServiceProducer getServiceProvider(int id)
Get a service provider.

Specified by:
getServiceProvider in interface ProviderService
Parameters:
id - The id of the service provider to get.
Returns:
The service artifact that represents the service provider or null if no Service Producer was found with that id.


Copyright © 2007-2012. All Rights Reserved.