Change code to use dmaap microservice
[appc.git] / appc-dg / appc-dg-shared / appc-dg-common / src / test / java / org / onap / appc / dg / common / impl / MockEventSender.java
1 package org.onap.appc.dg.common.impl;
2
3 import org.onap.appc.srvcomm.messaging.MessageDestination;
4 import org.onap.appc.srvcomm.messaging.event.EventMessage;
5 import org.onap.appc.srvcomm.messaging.event.EventSender;
6
7 public class MockEventSender extends EventSender {
8     
9     private EventMessage eventMessage;
10     private String topic;
11     private MessageDestination dest;
12     private boolean success = true;
13     
14     @Override
15     public boolean sendEvent(MessageDestination destination, EventMessage msg, String eventTopicName) {
16         eventMessage = msg;
17         topic = eventTopicName;
18         dest = destination;
19         return success;
20     }
21     
22     @Override
23     public boolean sendEvent(MessageDestination destination, EventMessage msg) {
24         eventMessage = msg;
25         topic = null;
26         dest = destination;
27         return success;
28     }
29     public void reset() {
30         eventMessage = null;
31         topic = null;
32         dest = null;
33         success = true;
34     }
35     
36     public void setSuccess(boolean success) {
37         this.success = success;
38     }
39     
40     public EventMessage getMessage() {
41         return eventMessage;
42     }
43     
44     public String getTopic() {
45         return topic;
46     }
47     
48     public MessageDestination getDestination() {
49         return dest;
50     }
51
52 }