diff options
author | Sandeep J <sandeejh@in.ibm.com> | 2018-11-16 14:48:51 +0530 |
---|---|---|
committer | Sandeep Jha <sandeejh@in.ibm.com> | 2018-11-16 09:23:32 +0000 |
commit | 9300dc88423197db6b160c4f7b94419b9eed6fcc (patch) | |
tree | 312783c05d2508391799779fe5b7875f126fde14 /ms | |
parent | 009719f00f0ad2c5856d20a9c0acb71937ccc06c (diff) |
added test case to AaiServiceImplTest
to increase code coverage
Issue-ID: CCSDK-552
Change-Id: Ib89f25c39bf0878170da6997ca74c587c4c72535
Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'ms')
2 files changed, 18 insertions, 2 deletions
diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImpl.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImpl.java index 6c4ae889..7356c3bd 100644 --- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImpl.java +++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImpl.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 @@ -125,4 +127,8 @@ public class AaiServiceImpl { } return this.restTemplate; } + + public void setAaiProps(AaiProps aaiProps) { + this.aaiProps = aaiProps; + } } diff --git a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImplTest.java b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImplTest.java index b25de210..8507bf65 100644 --- a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImplTest.java +++ b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImplTest.java @@ -4,8 +4,6 @@ * ================================================================================ * Copyright (C) 2018 IBM. * ================================================================================ - * 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 @@ -26,7 +24,9 @@ import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.apps.ms.neng.core.resource.model.AaiResponse; +import org.onap.ccsdk.apps.ms.neng.extinf.props.AaiProps; import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.web.client.RestTemplate; public class AaiServiceImplTest { private AaiServiceImpl aaiServiceImpl; @@ -48,4 +48,14 @@ 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"); + + } } |