Remove DMaaP dependency from AAI-Common
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / util / StoreNotificationEventTest.java
index 08cbba2..a0c3f63 100644 (file)
@@ -39,46 +39,46 @@ import org.junit.Ignore;
 import org.junit.Test;
 import org.mockito.Mockito;
 import org.onap.aai.AAISetup;
-import org.onap.aai.dmaap.AAIDmaapEventJMSProducer;
 import org.onap.aai.domain.notificationEvent.NotificationEvent.EventHeader;
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.introspection.Introspector;
 import org.onap.aai.introspection.Loader;
 import org.onap.aai.introspection.ModelType;
+import org.onap.aai.kafka.AAIKafkaEventJMSProducer;
 
 public class StoreNotificationEventTest extends AAISetup {
 
-    private static AAIDmaapEventJMSProducer producer;
+    private static AAIKafkaEventJMSProducer producer;
     private static StoreNotificationEvent sne;
 
     @BeforeClass
     public static void setUp() {
-        producer = Mockito.mock(AAIDmaapEventJMSProducer.class);
+        producer = Mockito.mock(AAIKafkaEventJMSProducer.class);
         // sne = new StoreNotificationEvent(producer, "transiationId", "sourceOfTruth");
     }
 
     @Before
     public void setUpBefore() {
-        producer = Mockito.mock(AAIDmaapEventJMSProducer.class);
+        producer = Mockito.mock(AAIKafkaEventJMSProducer.class);
         sne = new StoreNotificationEvent(producer, "transiationId", "sourceOfTruth");
 
     }
 
     @Test(expected = AAIException.class)
     public void testStoreEventNullObj() throws AAIException {
-        sne.storeEvent(new EventHeader(), null);
+        sne.storeEventAndSendToJms(new EventHeader(), null);
     }
 
     @Test(expected = AAIException.class)
     public void testStoreEventInvalidObjForPojoUtils() throws AAIException {
-        sne.storeEvent(new EventHeader(), new Object());
+        sne.storeEventAndSendToJms(new EventHeader(), new Object());
     }
 
     @Test
     public void testStoreEventEmptyEventHeader()
             throws AAIException, JsonGenerationException, JsonMappingException, IOException {
         JsonObject object = Json.createObjectBuilder().add("hello", "world").build();
-        String res = sne.storeEvent(new EventHeader(), object);
+        String res = sne.storeEventAndSendToJms(new EventHeader(), object);
 
         assertNotNull(res);
         assertTrue(res.contains("\"cambria.partition\" : \"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\""));
@@ -118,7 +118,7 @@ public class StoreNotificationEventTest extends AAISetup {
         eh.setSeverity("ALERT");
         eh.setVersion("v12");
 
-        String res = sne.storeEvent(eh, object);
+        String res = sne.storeEventAndSendToJms(eh, object);
 
         assertNotNull(res);
         assertTrue(res.contains("\"cambria.partition\" : \"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\""));
@@ -161,7 +161,7 @@ public class StoreNotificationEventTest extends AAISetup {
     @Test(expected = AAIException.class)
     public void testStoreEventIntrospectorNullObj() throws Exception {
         Loader loader = Mockito.mock(Loader.class);
-        sne.storeEvent(loader, null, null);
+        sne.storeEventAndSendToJms(loader, null, null);
     }
 
     @Ignore("Stopped working since the model driven story")
@@ -180,7 +180,7 @@ public class StoreNotificationEventTest extends AAISetup {
         eventHeader.setValue("severity", "ALERT");
         eventHeader.setValue("version", "v12");
         Introspector obj = loader.introspectorFromName("notification-event");
-        String res = sne.storeEvent(loader, eventHeader, obj);
+        String res = sne.storeEventAndSendToJms(loader, eventHeader, obj);
 
         assertNotNull(res);
         assertTrue(res.contains("\"cambria.partition\":\"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\""));
@@ -205,7 +205,7 @@ public class StoreNotificationEventTest extends AAISetup {
         Introspector eventHeader = loader.introspectorFromName("notification-event-header");
         Introspector obj = loader.introspectorFromName("notification-event");
 
-        String res = sne.storeEvent(loader, eventHeader, obj);
+        String res = sne.storeEventAndSendToJms(loader, eventHeader, obj);
 
         assertNotNull(res);
         assertTrue(res.contains("\"cambria.partition\":\"" + AAIConstants.UEB_PUB_PARTITION_AAI + "\""));