summaryrefslogtreecommitdiffstats
path: root/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi
diff options
context:
space:
mode:
authorDenes Nemeth <denes.nemeth@nokia.com>2018-04-03 17:32:13 +0200
committerDenes Nemeth <denes.nemeth@nokia.com>2018-04-04 14:08:23 +0200
commit2c1179b657efe2a291012d2b8f2eee2179402d27 (patch)
tree12343f52bda03c49e576ff72debe831c57c8cc5e /nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi
parent0278d01123ce3de23d842a94a5ab99dba8853867 (diff)
Fixes in LCM
Change-Id: I9dfdacf32970c86b595939f6cd92b6eb276ebf90 Issue-ID: VFC-728 Signed-off-by: Denes Nemeth <denes.nemeth@nokia.com>
Diffstat (limited to 'nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi')
-rw-r--r--nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestSwaggerDefinitionConsistency.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestSwaggerDefinitionConsistency.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestSwaggerDefinitionConsistency.java
index f88305a0..d39a1445 100644
--- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestSwaggerDefinitionConsistency.java
+++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestSwaggerDefinitionConsistency.java
@@ -37,7 +37,7 @@ import static org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.util.TestUtil.loadFile;
public class TestSwaggerDefinitionConsistency extends TestBase {
- public static final HashSet<Class<?>> CLASSES = Sets.newHashSet(LcmApi.class, LcnApi.class, SwaggerApi.class, ConverterApi.class);
+ public static final HashSet<Class<?>> CLASSES = Sets.newHashSet(LcmApi.class, LcnApi.class, SwaggerApi.class, ConverterApi.class, SoApi.class);
@Test
public void test() throws Exception {
@@ -69,15 +69,31 @@ public class TestSwaggerDefinitionConsistency extends TestBase {
}
private void locate(String path) {
+ Set<String> paths = new HashSet<>();
for (Class<?> clazz : CLASSES) {
RequestMapping basePath = clazz.getAnnotation(RequestMapping.class);
for (Method method : clazz.getMethods()) {
RequestMapping methodMapping = method.getAnnotation(RequestMapping.class);
- if (methodMapping != null && path.equals(basePath.value()[0] + methodMapping.value()[0])) {
- return;
+ if (methodMapping != null) {
+ paths.add(basePath.value()[0] + methodMapping.value()[0]);
+ if (path.equals(basePath.value()[0] + methodMapping.value()[0])) {
+ return;
+ }
+ }
+ }
+ }
+ for (Class<?> clazz : CLASSES) {
+ RequestMapping basePath = clazz.getAnnotation(RequestMapping.class);
+ for (Method method : clazz.getMethods()) {
+ RequestMapping methodMapping = method.getAnnotation(RequestMapping.class);
+ if (methodMapping != null) {
+ paths.add(basePath.value()[0] + methodMapping.value()[0]);
+ if (path.equals(basePath.value()[0] + methodMapping.value()[0])) {
+ return;
+ }
}
}
}
- throw new NoSuchElementException(path);
+ throw new NoSuchElementException(path + " in " + paths);
}
}