public class InMemoryNcFake
extends java.lang.Object
It should be used only to simplify unit test setups, and never in an operational environment.
Unit tests may use this class in two ways:
ContainerServicesBase.createNotificationChannelPublisher(String, Class)
and ContainerServicesBase.createNotificationChannelSubscriber(String, Class)
are overridden and use this InMemoryNcFake class. This should work also for cases where the container services
get passed around the code, and deep down in some class under test the suppliers / subscribers are created.
| Constructor and Description |
|---|
InMemoryNcFake(ContainerServicesBase services,
java.lang.String channelName) |
| Modifier and Type | Method and Description |
|---|---|
<T> AcsEventPublisher<T> |
createPublisher(java.lang.String publisherName,
java.lang.Class<T> eventType)
Factory method for publishers.
|
<T> AcsEventSubscriber<T> |
createSubscriber(java.lang.String subscriberName,
java.lang.Class<T> eventType)
Factory method for subscribers.
|
boolean |
equals(java.lang.Object obj)
equals based on {
channelName. |
int |
hashCode()
hashCode() based on {
channelName. |
public InMemoryNcFake(ContainerServicesBase services, java.lang.String channelName)
services - channelName - public <T> AcsEventPublisher<T> createPublisher(java.lang.String publisherName, java.lang.Class<T> eventType)
public <T> AcsEventSubscriber<T> createSubscriber(java.lang.String subscriberName, java.lang.Class<T> eventType) throws AcsJException
AcsJExceptionpublic int hashCode()
channelName.hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
channelName.equals in class java.lang.Object