aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-09-14 18:30:51 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-09-14 18:32:47 +0530
commit0963b7d3e249f7474e714c0b397e3e1a1dff41c8 (patch)
tree91354bec9cbf7b53c4ba7d105af208084307dee1
parent812bd02e844b4a518e5f02506b8fd7cb3a306636 (diff)
added test cases to SpringServiceTest.java
to increase code coverage Issue-ID: CCSDK-552 Change-Id: I6f6964410c8743d4141243e7a6b32ab7393d60ec Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceTest.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceTest.java b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceTest.java
index 303692c5..b4821a21 100644
--- a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceTest.java
+++ b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceTest.java
@@ -4,6 +4,8 @@
* ================================================================================
* Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -31,6 +33,7 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.ccsdk.apps.ms.neng.core.resource.model.HelloWorld;
import org.onap.ccsdk.apps.ms.neng.core.resource.model.NameGenRequest;
import org.onap.ccsdk.apps.ms.neng.core.validator.ExternalKeyValidator;
import org.onap.ccsdk.apps.ms.neng.persistence.entity.GeneratedName;
@@ -105,4 +108,16 @@ public class SpringServiceTest {
Mockito.when(generatedNameRepository.findByExternalId(req.get("external-key"))).thenReturn(generatedNameList);
Assert.assertNotNull(springserviceImpl.releaseNetworkElementName(request));
}
+
+ @Test
+ public void testGetQuickHello()
+ {
+ Assert.assertTrue(springserviceImpl.getQuickHello("testMessage") instanceof HelloWorld);
+ }
+
+ @Test
+ public void testGetQuickHelloForNullMessage()
+ {
+ Assert.assertTrue(springserviceImpl.getQuickHello("") instanceof HelloWorld);
+ }
}