summaryrefslogtreecommitdiffstats
path: root/ms/neng
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2018-11-19 22:41:29 +0000
committerGerrit Code Review <gerrit@onap.org>2018-11-19 22:41:29 +0000
commit4858eb877b1f84df205b7d2c48595c2f708257a1 (patch)
tree82c9c40e6ee31c5e327c9a071f360d975b2ff521 /ms/neng
parentfc22ebd1938b926f7c785a33ea18f214f9aaf0f3 (diff)
parent9300dc88423197db6b160c4f7b94419b9eed6fcc (diff)
Merge "added test case to AaiServiceImplTest"
Diffstat (limited to 'ms/neng')
-rw-r--r--ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImpl.java6
-rw-r--r--ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/service/extinf/impl/AaiServiceImplTest.java14
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");
+
+ }
}