From 0963b7d3e249f7474e714c0b397e3e1a1dff41c8 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Fri, 14 Sep 2018 18:30:51 +0530 Subject: added test cases to SpringServiceTest.java to increase code coverage Issue-ID: CCSDK-552 Change-Id: I6f6964410c8743d4141243e7a6b32ab7393d60ec Signed-off-by: Sandeep J --- .../apps/ms/neng/core/service/SpringServiceTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ms') 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); + } } -- cgit 1.2.3-korg