Add plugin to check coverage
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / util / StoreNotificationEventTest.java
index 5bd7984..d3725f4 100644 (file)
@@ -112,7 +112,7 @@ public class StoreNotificationEventTest extends AAISetup {
                eh.setSourceName("source");
                eh.setSequenceNumber("23");
                eh.setSeverity("ALERT");
-               eh.setVersion("v11");
+               eh.setVersion("v12");
 
                String res = sne.storeEvent(eh, object);
 
@@ -126,7 +126,7 @@ public class StoreNotificationEventTest extends AAISetup {
                assertTrue(res.contains("\"sequence-number\" : \"23\""));
                assertTrue(res.contains("\"severity\" : \"ALERT\""));
                assertTrue(res.contains("\"event-type\" : \"surprise\""));
-               assertTrue(res.contains("\"version\" : \"v11\""));
+               assertTrue(res.contains("\"version\" : \"v12\""));
                assertTrue(res.contains("\"action\" : \"action!\""));
                assertTrue(res.contains("\"entity-link\" : \"entity-link\""));
                assertTrue(res.contains("\"entity\""));
@@ -140,20 +140,20 @@ public class StoreNotificationEventTest extends AAISetup {
        public void testStoreDynamicEventNullObj() throws AAIException {
                DynamicEntity eventHeader = Mockito.mock(DynamicEntity.class);
                DynamicJAXBContext notificationJaxbContext = Mockito.mock(DynamicJAXBContext.class);
-               sne.storeDynamicEvent(notificationJaxbContext, "v11", eventHeader, null);
+               sne.storeDynamicEvent(notificationJaxbContext, "v12", eventHeader, null);
        }
 
-       @Test(expected = AAIException.class)
+       @Test(expected = Exception.class)
        public void testStoreDynamicEventAAIException() throws Exception {
                DynamicEntity eventHeader = Mockito.mock(DynamicEntity.class);
                DynamicEntity obj = Mockito.mock(DynamicEntity.class);
                DynamicJAXBContext notificationJaxbContext = Mockito.mock(DynamicJAXBContext.class);
                ClassLoader cl = getClass().getClassLoader();
-               InputStream is = cl.getResourceAsStream("oxm/aai_oxm_v11.xml");
+               InputStream is = cl.getResourceAsStream("oxm/aai_oxm_v12.xml");
                Map<String, Object> properties = new HashMap<String, Object>();
                properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, is);
                DynamicJAXBContext notificationJaxbContextReal = DynamicJAXBContextFactory.createContextFromOXM(cl, properties);
-               DynamicType dtReal = notificationJaxbContextReal.getDynamicType("inventory.aai.onap.org.v11.NotificationEvent");
+               DynamicType dtReal = notificationJaxbContextReal.getDynamicType("inventory.aai.onap.org.v12.NotificationEvent");
                DynamicType dt = Mockito.mock(DynamicType.class);
                DynamicEntity notificationEventReal = dtReal.newDynamicEntity();
                JAXBMarshaller marshaller = Mockito.mock(JAXBMarshaller.class);
@@ -163,7 +163,7 @@ public class StoreNotificationEventTest extends AAISetup {
                Mockito.when(notificationJaxbContext.createMarshaller()).thenReturn(marshaller);
                Mockito.doNothing().when(marshaller).marshal(Mockito.any(DynamicJAXBContext.class), Mockito.any(StringWriter.class));
 
-               sne.storeDynamicEvent(notificationJaxbContext, "v11", eventHeader, obj);
+               sne.storeDynamicEvent(notificationJaxbContext, "v12", eventHeader, obj);
        }
        
        @Test(expected = AAIException.class)
@@ -174,7 +174,7 @@ public class StoreNotificationEventTest extends AAISetup {
        
        @Test
        public void testStoreEventIntrospector() throws Exception {
-               Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v11);
+               Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v12);
                Introspector eventHeader = loader.introspectorFromName("notification-event-header");
                eventHeader.setValue("id", "123");
                eventHeader.setValue("timestamp", "current-time");
@@ -185,7 +185,7 @@ public class StoreNotificationEventTest extends AAISetup {
                eventHeader.setValue("source-name", "source");
                eventHeader.setValue("sequence-number", "23");
                eventHeader.setValue("severity", "ALERT");
-               eventHeader.setValue("version", "v11");
+               eventHeader.setValue("version", "v12");
                
                Introspector obj = loader.introspectorFromName("notification-event");
                
@@ -201,7 +201,7 @@ public class StoreNotificationEventTest extends AAISetup {
                assertTrue(res.contains("\"sequence-number\":\"23\""));
                assertTrue(res.contains("\"severity\":\"ALERT\""));
                assertTrue(res.contains("\"event-type\":\"surprise\""));
-               assertTrue(res.contains("\"version\":\"v11\""));
+               assertTrue(res.contains("\"version\":\"v12\""));
                assertTrue(res.contains("\"action\":\"action!\""));
                assertTrue(res.contains("\"entity-link\":\"entity-link\""));
                assertTrue(res.contains("\"notification-event\""));
@@ -209,7 +209,7 @@ public class StoreNotificationEventTest extends AAISetup {
        
        @Test
        public void testStoreEventIntrospectorEmptyEventHeader() throws Exception {
-               Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v11);
+               Loader loader = LoaderFactory.createLoaderForVersion(ModelType.MOXY, Version.v12);
                Introspector eventHeader = loader.introspectorFromName("notification-event-header");
                Introspector obj = loader.introspectorFromName("notification-event");