Added test cases to AaiServiceImpl.java 29/76029/1
authorezhil <ezhrajam@in.ibm.com>
Sat, 19 Jan 2019 12:29:37 +0000 (17:59 +0530)
committerezhil <ezhrajam@in.ibm.com>
Sat, 19 Jan 2019 12:36:04 +0000 (18:06 +0530)
Change-Id: Ic3811991d3d6988537b3f2119a18092b9f6f8192
Issue-ID: CCSDK-963
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImplTest.java

index 8507bf6..f7d0bc2 100644 (file)
@@ -48,14 +48,18 @@ public class AaiServiceImplTest {
         AaiResponse aaiResponse = aaiServiceImpl.buildResponse(true);
         Assert.assertEquals(aaiResponse.isRecFound(), true);
     }
-    
+
     @Test(expected= Exception.class)
     public void testValidate() throws Exception {
         AaiProps aaiProps=new AaiProps();
         aaiProps.setUriBase("http://");
         aaiServiceImpl.setAaiProps(aaiProps);
         aaiServiceImpl.setRestTemplate(new RestTemplate());
-        aaiServiceImpl.validate("testUrl/","testName");
-        
+        Assert.assertTrue(aaiServiceImpl.validate("testUrl/","testName"));
+    }
+    @Test(expected= Exception.class)
+    public void testGetRestTemplate_Null() throws Exception {
+        aaiServiceImpl.setRestTemplate(null);
+        Assert.assertNotNull(aaiServiceImpl.getRestTemplate());
     }
 }