From 7734d5ca985fb0f47347d644a53b76b46da4cf41 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Wed, 26 Jun 2024 14:25:42 +0200 Subject: Implement gremlin-based pagination in resources - update Janusgraph to 0.5.0 + tinkerpop to 3.4.13 - leverage new pagination from aai-common that paginates in the graph, rather than the java code - introduce new `includeTotalCount` parameter that allows disabling the total count for the page - remove meaningless javadoc comments Issue-ID: AAI-3901 Change-Id: Ifca45e524b54f4978b5269361184813f4cfe5461 Signed-off-by: Fiete Ostkamp --- aai-resources/pom.xml | 47 +++--- .../java/org/onap/aai/rest/LegacyMoxyConsumer.java | 184 ++++++--------------- .../org/onap/aai/rest/BulkProcessConsumerTest.java | 6 +- .../org/onap/aai/rest/LegacyMoxyConsumerTest.java | 50 +++--- .../onap/aai/rest/URLFromVertexIdConsumerTest.java | 4 +- .../org/onap/aai/rest/VertexIdConsumerTest.java | 4 +- pom.xml | 6 +- 7 files changed, 115 insertions(+), 186 deletions(-) diff --git a/aai-resources/pom.xml b/aai-resources/pom.xml index a62474b..b385805 100644 --- a/aai-resources/pom.xml +++ b/aai-resources/pom.xml @@ -28,7 +28,7 @@ org.onap.aai.resources resources - 1.14.2-SNAPSHOT + 1.14.3-SNAPSHOT 1.8 @@ -82,15 +82,13 @@ 2.4.13 - 5.3.13 + + 0.5.0 + 3.4.13 + 4.0.1 - ${spring.version} - ${spring.version} 11.0.2 - 1.3.19 - 1.6.6 - 1.6.6 - 1.6.6 + 1.6.6 1.6.1 4.4.0 2.6.2 @@ -318,26 +316,27 @@ org.springframework.cloud spring-cloud-sleuth-zipkin - + - io.micrometer - micrometer-spring-legacy - ${micrometer-spring-legacy.version} + org.springframework + spring-test + test + io.micrometer micrometer-core - ${micrometer-core.version} + ${micrometer.version} io.micrometer micrometer-registry-prometheus - ${micrometer-registry-prometheus.version} + ${micrometer.version} io.micrometer micrometer-jersey2 - ${micrometer-jersey2} + ${micrometer.version} javax.jms @@ -660,11 +659,6 @@ indy ${groovy.version} - - org.springframework - spring-test - test - org.springframework.boot spring-boot-test @@ -680,6 +674,12 @@ + + org.janusgraph + janusgraph-inmemory + ${janusgraph.version} + + org.apache.tinkerpop gremlin-groovy @@ -741,6 +741,13 @@ guava 25.0-jre + + + + io.dropwizard.metrics + metrics-core + 3.2.6 + diff --git a/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java b/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java index 4912a00..c518258 100644 --- a/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java +++ b/aai-resources/src/main/java/org/onap/aai/rest/LegacyMoxyConsumer.java @@ -3,6 +3,7 @@ * org.onap.aai * ================================================================================ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright © 2024 Deutsche Telekom. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +44,10 @@ import org.onap.aai.exceptions.AAIException; import org.onap.aai.introspection.Introspector; import org.onap.aai.introspection.Loader; import org.onap.aai.introspection.sideeffect.OwnerCheck; +import org.onap.aai.query.builder.Pageable; import org.onap.aai.parsers.query.QueryParser; +import org.onap.aai.query.builder.QueryOptions; +import org.onap.aai.query.builder.Sort; import org.onap.aai.rest.db.DBRequest; import org.onap.aai.rest.db.HttpEntry; import org.onap.aai.rest.exceptions.AAIInvalidXMLNamespace; @@ -67,16 +71,6 @@ public class LegacyMoxyConsumer extends RESTAPI { private static final Logger logger = LoggerFactory.getLogger(LegacyMoxyConsumer.class.getName()); - /** - * - * @param content - * @param versionParam - * @param uri - * @param headers - * @param info - * @param req - * @return - */ @PUT @Path("/{uri: .+}") @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @@ -89,17 +83,6 @@ public class LegacyMoxyConsumer extends RESTAPI { return this.handleWrites(mediaType, HttpMethod.PUT, content, versionParam, uri, headers, info, roles); } - /** - * Update relationship. - * - * @param content the content - * @param versionParam the version param - * @param uri the uri - * @param headers the headers - * @param info the info - * @param req the req - * @return the response - */ @PUT @Path("/{uri: .+}/relationship-list/relationship") @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @@ -164,17 +147,6 @@ public class LegacyMoxyConsumer extends RESTAPI { return response; } - /** - * Patch. - * - * @param content the content - * @param versionParam the version param - * @param uri the uri - * @param headers the headers - * @param info the info - * @param req the req - * @return the response - */ @PATCH @Path("/{uri: .+}") @Consumes({"application/merge-patch+json"}) @@ -204,57 +176,43 @@ public class LegacyMoxyConsumer extends RESTAPI { .build(); } - /** - * Gets the legacy. - * - * @param content the content - * @param versionParam the version param - * @param uri the uri - * @param depthParam the depth param - * @param cleanUp the clean up - * @param headers the headers - * @param info the info - * @param req the req - * @return the legacy - */ @GET @Path("/{uri: .+}") @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public Response getLegacy(String content, @DefaultValue("-1") @QueryParam("resultIndex") String resultIndex, - @DefaultValue("-1") @QueryParam("resultSize") String resultSize, @PathParam("version") String versionParam, - @PathParam("uri") @Encoded String uri, @DefaultValue("all") @QueryParam("depth") String depthParam, - @DefaultValue("false") @QueryParam("cleanup") String cleanUp, @Context HttpHeaders headers, - @Context UriInfo info, @Context HttpServletRequest req) { + public Response getLegacy( + @PathParam("version") String versionParam, + @PathParam("uri") @Encoded String uri, + @DefaultValue("-1") @QueryParam("resultIndex") int resultIndex, + @DefaultValue("-1") @QueryParam("resultSize") int resultSize, + @DefaultValue("true") @QueryParam("includeTotalCount") boolean includeTotalCount, + // @DefaultValue("false") @QueryParam("sort") Sort sort, + @DefaultValue("all") @QueryParam("depth") String depthParam, + @DefaultValue("false") @QueryParam("cleanup") String cleanUp, + @Context HttpHeaders headers, + @Context UriInfo info, + @Context HttpServletRequest req) { Set roles = getRoles(req.getUserPrincipal(), req.getMethod()); + Pageable pageable = includeTotalCount == false + ? new Pageable(resultIndex -1, resultSize) + : new Pageable(resultIndex -1, resultSize).includeTotalCount(); return runner(AAIConstants.AAI_CRUD_TIMEOUT_ENABLED, AAIConstants.AAI_CRUD_TIMEOUT_APP, AAIConstants.AAI_CRUD_TIMEOUT_LIMIT, headers, info, HttpMethod.GET, new AaiCallable() { @Override public Response process() { - return getLegacy(content, versionParam, uri, depthParam, cleanUp, headers, info, req, - new HashSet(), resultIndex, resultSize, roles); + return getLegacy(versionParam, uri, depthParam, cleanUp, headers, info, req, + new HashSet(), pageable, roles); } }); } /** * This method exists as a workaround for filtering out undesired query params while routing between REST consumers - * - * @param content - * @param versionParam - * @param uri - * @param depthParam - * @param cleanUp - * @param headers - * @param info - * @param req - * @param removeQueryParams - * @return */ - public Response getLegacy(String content, String versionParam, String uri, String depthParam, String cleanUp, + public Response getLegacy(String versionParam, String uri, String depthParam, String cleanUp, HttpHeaders headers, UriInfo info, HttpServletRequest req, Set removeQueryParams, - String resultIndex, String resultSize, Set roles) { + Pageable pageable, Set roles) { String sourceOfTruth = headers.getRequestHeaders().getFirst("X-FromAppId"); String transId = headers.getRequestHeaders().getFirst("X-TransactionId"); Response response; @@ -291,12 +249,13 @@ public class LegacyMoxyConsumer extends RESTAPI { DBRequest request = new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, headers, info, transId).build(); List requests = Collections.singletonList(request); - if (hasValidPaginationParams(resultIndex, resultSize)) { - traversalUriHttpEntry.setPaginationIndex(Integer.parseInt(resultIndex)); - traversalUriHttpEntry.setPaginationBucket(Integer.parseInt(resultSize)); + + Pair>> responsesTuple = null; + if (hasValidPaginationParams(pageable)) { + responsesTuple = traversalUriHttpEntry.process(requests, sourceOfTruth, roles, true, new QueryOptions(pageable)); + } else { + responsesTuple = traversalUriHttpEntry.process(requests, sourceOfTruth, roles); } - Pair>> responsesTuple = - traversalUriHttpEntry.process(requests, sourceOfTruth, roles); response = responsesTuple.getValue1().get(0).getValue1(); @@ -319,14 +278,14 @@ public class LegacyMoxyConsumer extends RESTAPI { return response; } - private boolean hasValidPaginationParams(String resultIndex, String resultSize) { - return resultIndex != null && !"-1".equals(resultIndex) && resultSize != null && !"-1".equals(resultSize); + private boolean hasValidPaginationParams(Pageable pageable) { + return pageable.getPage() >= 0 && pageable.getPageSize() > 0; } private MultivaluedMap removeNonFilterableParams(MultivaluedMap params) { String[] toRemove = - {"depth", "cleanup", "nodes-only", "format", "resultIndex", "resultSize", "skip-related-to"}; + {"depth", "cleanup", "nodes-only", "format", "resultIndex", "resultSize", "includeTotalCount", "skip-related-to"}; Set toRemoveSet = Arrays.stream(toRemove).collect(Collectors.toSet()); MultivaluedMap cleanedParams = new MultivaluedHashMap<>(); @@ -339,17 +298,6 @@ public class LegacyMoxyConsumer extends RESTAPI { return cleanedParams; } - /** - * Delete. - * - * @param versionParam the version param - * @param uri the uri - * @param headers the headers - * @param info the info - * @param resourceVersion the resource version - * @param req the req - * @return the response - */ @DELETE @Path("/{uri: .+}") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @@ -494,31 +442,30 @@ public class LegacyMoxyConsumer extends RESTAPI { @Path("/{uri: .+}/relationship-list") @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) - public Response getRelationshipList(@DefaultValue("-1") @QueryParam("resultIndex") String resultIndex, - @DefaultValue("-1") @QueryParam("resultSize") String resultSize, @PathParam("version") String versionParam, - @PathParam("uri") @Encoded String uri, @DefaultValue("false") @QueryParam("cleanup") String cleanUp, - @Context HttpHeaders headers, @Context HttpServletRequest req, @Context UriInfo info) { + public Response getRelationshipList( + @PathParam("version") String versionParam, + @PathParam("uri") @Encoded String uri, + @DefaultValue("-1") @QueryParam("resultIndex") int resultIndex, + @DefaultValue("-1") @QueryParam("resultSize") int resultSize, + @DefaultValue("true") @QueryParam("includeTotalCount") boolean includeTotalCount, + @DefaultValue("false") @QueryParam("cleanup") String cleanUp, + @Context HttpHeaders headers, + @Context HttpServletRequest req, + @Context UriInfo info) { + Pageable pageable = includeTotalCount == false + ? new Pageable(resultIndex -1, resultSize) + : new Pageable(resultIndex -1, resultSize).includeTotalCount(); return runner(AAIConstants.AAI_CRUD_TIMEOUT_ENABLED, AAIConstants.AAI_CRUD_TIMEOUT_APP, AAIConstants.AAI_CRUD_TIMEOUT_LIMIT, headers, info, HttpMethod.GET, new AaiCallable() { @Override public Response process() { - return getRelationshipList(versionParam, req, uri, cleanUp, headers, info, resultIndex, - resultSize); + return getRelationshipList(versionParam, req, uri, cleanUp, headers, info, pageable); } }); } - /** - * - * @param versionParam - * @param uri - * @param cleanUp - * @param headers - * @param info - * @return - */ public Response getRelationshipList(String versionParam, HttpServletRequest req, String uri, String cleanUp, - HttpHeaders headers, UriInfo info, String resultIndex, String resultSize) { + HttpHeaders headers, UriInfo info, Pageable pageable) { String sourceOfTruth = headers.getRequestHeaders().getFirst("X-FromAppId"); String transId = headers.getRequestHeaders().getFirst("X-TransactionId"); Response response = null; @@ -557,13 +504,13 @@ public class LegacyMoxyConsumer extends RESTAPI { .build(); List requests = new ArrayList<>(); requests.add(request); - if (hasValidPaginationParams(resultIndex, resultSize)) { - traversalUriHttpEntry.setPaginationIndex(Integer.parseInt(resultIndex)); - traversalUriHttpEntry.setPaginationBucket(Integer.parseInt(resultSize)); - } - Pair>> responsesTuple = - traversalUriHttpEntry.process(requests, sourceOfTruth); + Pair>> responsesTuple = null; + if (hasValidPaginationParams(pageable)) { + responsesTuple = traversalUriHttpEntry.process(requests, sourceOfTruth, Collections.emptySet(), true, new QueryOptions(pageable)); + } else { + responsesTuple = traversalUriHttpEntry.process(requests, sourceOfTruth); + } response = responsesTuple.getValue1().get(0).getValue1(); } catch (AAIException e) { response = consumerExceptionResponseGenerator(headers, info, HttpMethod.GET_RELATIONSHIP, e); @@ -583,13 +530,6 @@ public class LegacyMoxyConsumer extends RESTAPI { return response; } - /** - * Validate request. - * - * @param info the info - * @throws AAIException the AAI exception - * @throws UnsupportedEncodingException the unsupported encoding exception - */ private void validateRequest(UriInfo info) throws AAIException, UnsupportedEncodingException { if (!ValidateEncoding.getInstance().validate(info)) { @@ -597,12 +537,6 @@ public class LegacyMoxyConsumer extends RESTAPI { } } - /** - * Gets the path. - * - * @param info the info - * @return the path - */ private String getPath(UriInfo info) { String path = info.getPath(false); MultivaluedMap map = info.getQueryParameters(false); @@ -622,18 +556,6 @@ public class LegacyMoxyConsumer extends RESTAPI { } - /** - * Handle writes. - * - * @param mediaType the media type - * @param method the method - * @param content the content - * @param versionParam the version param - * @param uri the uri - * @param headers the headers - * @param info the info - * @return the response - */ private Response handleWrites(MediaType mediaType, HttpMethod method, String content, String versionParam, String uri, HttpHeaders headers, UriInfo info, Set roles) { diff --git a/aai-resources/src/test/java/org/onap/aai/rest/BulkProcessConsumerTest.java b/aai-resources/src/test/java/org/onap/aai/rest/BulkProcessConsumerTest.java index e64ecc0..4c2a9f0 100644 --- a/aai-resources/src/test/java/org/onap/aai/rest/BulkProcessConsumerTest.java +++ b/aai-resources/src/test/java/org/onap/aai/rest/BulkProcessConsumerTest.java @@ -178,8 +178,8 @@ public class BulkProcessConsumerTest extends BulkProcessorTestAbstraction { when(uriInfo.getPath()).thenReturn(uri); when(uriInfo.getPath(false)).thenReturn(uri); - Response response = legacyMoxyConsumer.getLegacy("", "-1", "-1", schemaVersions.getDefaultVersion().toString(), - uri, "all", "false", httpHeaders, uriInfo, new MockHttpServletRequest("GET", "http://www.test.com")); + Response response = legacyMoxyConsumer.getLegacy(schemaVersions.getDefaultVersion().toString(), uri, -1, -1, false, + "all", "false", httpHeaders, uriInfo, new MockHttpServletRequest("GET", "http://www.test.com")); assertNotNull(response, "Response from the legacy moxy consumer returned null"); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), @@ -199,7 +199,7 @@ public class BulkProcessConsumerTest extends BulkProcessorTestAbstraction { "Expected to return status created from the response"); queryParameters.add("depth", "10000"); - response = legacyMoxyConsumer.getLegacy("", "-1", "-1", schemaVersions.getDefaultVersion().toString(), uri, + response = legacyMoxyConsumer.getLegacy(schemaVersions.getDefaultVersion().toString(), uri, -1, -1, false, "all", "false", httpHeaders, uriInfo, new MockHttpServletRequest("GET", "http://www.test.com")); assertNotNull(response, "Response from the legacy moxy consumer returned null"); diff --git a/aai-resources/src/test/java/org/onap/aai/rest/LegacyMoxyConsumerTest.java b/aai-resources/src/test/java/org/onap/aai/rest/LegacyMoxyConsumerTest.java index 1524f69..e54c8e5 100644 --- a/aai-resources/src/test/java/org/onap/aai/rest/LegacyMoxyConsumerTest.java +++ b/aai-resources/src/test/java/org/onap/aai/rest/LegacyMoxyConsumerTest.java @@ -155,8 +155,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { when(uriInfo.getPath(false)).thenReturn(uri); MockHttpServletRequest mockReqGet = new MockHttpServletRequest("GET", uri); - Response response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, - uri, "all", "false", httpHeaders, uriInfo, mockReqGet); + Response response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, + false, "all", "false", httpHeaders, uriInfo, mockReqGet); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); @@ -173,7 +173,7 @@ public class LegacyMoxyConsumerTest extends AAISetup { queryParameters.add("depth", "10000"); - response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, uri, + response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, false, "10000", "false", httpHeaders, uriInfo, mockReqGet); code = response.getStatus(); @@ -203,7 +203,7 @@ public class LegacyMoxyConsumerTest extends AAISetup { assertEquals(Response.Status.NO_CONTENT.getStatusCode(), response.getStatus()); - response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, uri, + response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, false, "all", "false", httpHeaders, uriInfo, mockReqGet); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); @@ -222,8 +222,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { when(uriInfo.getPath(false)).thenReturn(uri); MockHttpServletRequest mockReqGet = new MockHttpServletRequest("GET", uri); - Response response = legacyMoxyConsumer.getLegacy("", "1", "10", defaultSchemaVersion, - uri, "all", "false", httpHeaders, uriInfo, mockReqGet); + Response response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, 1, 10, true, + "all", "false", httpHeaders, uriInfo, mockReqGet); assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); } @@ -330,7 +330,7 @@ public class LegacyMoxyConsumerTest extends AAISetup { assertEquals(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), code); logger.info("Response Code: " + code + "\tEntity: " + response.getEntity()); mockReq = new MockHttpServletRequest("GET", uri); - response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, uri, + response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, false, "all", "false", httpHeaders, uriInfo, mockReq); assertNotNull(response, "Response from the legacy moxy consumer returned null"); @@ -372,7 +372,7 @@ public class LegacyMoxyConsumerTest extends AAISetup { assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), code); mockReq = new MockHttpServletRequest("GET", uri); - response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, uri, + response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, false, "all", "false", httpHeaders, uriInfo, mockReq); assertNotNull(response, "Response from the legacy moxy consumer returned null"); @@ -408,8 +408,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { when(uriInfo.getPath(false)).thenReturn(uri); MockHttpServletRequest mockReq = new MockHttpServletRequest("GET", uri); - Response response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, - uri, "all", "false", httpHeaders, uriInfo, mockReq); + Response response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, + false, "all", "false", httpHeaders, uriInfo, mockReq); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); mockReq = new MockHttpServletRequest("PUT", uri); @@ -449,8 +449,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { HttpServletRequest mockRequest = Mockito.mock(HttpServletRequest.class); when(mockRequest.getRequestURL()).thenReturn(new StringBuffer(String.format("https://localhost:8447/aai/%s/", defaultSchemaVersion) + uri)); - Response response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, - uri, "all", "false", httpHeaders, uriInfo, mockRequest); + Response response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, + false, "all", "false", httpHeaders, uriInfo, mockRequest); assertNotNull(response, "Response from the legacy moxy consumer returned null"); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), @@ -470,7 +470,7 @@ public class LegacyMoxyConsumerTest extends AAISetup { "Expected to return status created from the response"); queryParameters.add("depth", "10000"); - response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, uri, + response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, false, "all", "false", httpHeaders, uriInfo, mockRequest); assertNotNull(response, "Response from the legacy moxy consumer returned null"); @@ -585,8 +585,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); MockHttpServletRequest mockReqGet = new MockHttpServletRequest("GET", uri); - Response response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, - uri, "all", "false", httpHeaders, uriInfo, mockReqGet); + Response response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, + false, "all", "false", httpHeaders, uriInfo, mockReqGet); assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); } @@ -605,8 +605,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { when(httpHeaders.getRequestHeaders()).thenReturn(headersMultiMap); MockHttpServletRequest mockReqGet = new MockHttpServletRequest("GET", uri); - Response response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, - uri, "all", "false", httpHeaders, uriInfo, mockReqGet); + Response response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, uri, -1, -1, + false, "all", "false", httpHeaders, uriInfo, mockReqGet); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); } @@ -649,8 +649,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { HttpServletRequest mockRequest = Mockito.mock(HttpServletRequest.class); when(mockRequest.getRequestURL()) .thenReturn(new StringBuffer(String.format("https://localhost:8447/aai/%s/", defaultSchemaVersion) + getRelationshipUri)); - response = legacyMoxyConsumer.getRelationshipList("1", "1", defaultSchemaVersion, - getRelationshipUri, "false", httpHeaders, mockRequest, uriInfo); + response = legacyMoxyConsumer.getRelationshipList(defaultSchemaVersion, + getRelationshipUri, 1,1, false, "false", httpHeaders, mockRequest, uriInfo); code = response.getStatus(); if (!VALID_HTTP_STATUS_CODES.contains(code)) { @@ -702,8 +702,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { HttpServletRequest mockRequest = Mockito.mock(HttpServletRequest.class); when(mockRequest.getRequestURL()) .thenReturn(new StringBuffer(String.format("https://localhost:8447/aai/%s/", defaultSchemaVersion) + getRelationshipUri)); - response = legacyMoxyConsumer.getRelationshipList("1", "1", defaultSchemaVersion, - getRelationshipUri, "false", httpHeaders, mockRequest, uriInfo); + response = legacyMoxyConsumer.getRelationshipList(defaultSchemaVersion, + getRelationshipUri, 1, 1, false, "false", httpHeaders, mockRequest, uriInfo); queryParameters.remove("format"); code = response.getStatus(); @@ -767,8 +767,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { when(mockRequest.getRequestURL()) .thenReturn(new StringBuffer(String.format("https://localhost:8447/aai/%s/", defaultSchemaVersion) + getRelationshipUri)); Response response = - legacyMoxyConsumer.getRelationshipList("1", "1", defaultSchemaVersion, - getRelationshipUri, "false", httpHeaders, mockRequest, uriInfo); + legacyMoxyConsumer.getRelationshipList(defaultSchemaVersion, + getRelationshipUri, 1, 1, false, "false", httpHeaders, mockRequest, uriInfo); int code = response.getStatus(); if (!VALID_HTTP_STATUS_CODES.contains(code)) { @@ -1139,8 +1139,8 @@ public class LegacyMoxyConsumerTest extends AAISetup { private Response getMockResponse(String mockUri) throws IOException, JSONException { MockHttpServletRequest mockReq = new MockHttpServletRequest("GET", mockUri); - Response response = legacyMoxyConsumer.getLegacy("", null, null, defaultSchemaVersion, - mockUri, "10000", "false", httpHeaders, uriInfo, mockReq); + Response response = legacyMoxyConsumer.getLegacy(defaultSchemaVersion, mockUri, -1, -1, + false, "10000", "false", httpHeaders, uriInfo, mockReq); String responseEntity = response.getEntity().toString(); int code = response.getStatus(); if (!VALID_HTTP_STATUS_CODES.contains(code)) { diff --git a/aai-resources/src/test/java/org/onap/aai/rest/URLFromVertexIdConsumerTest.java b/aai-resources/src/test/java/org/onap/aai/rest/URLFromVertexIdConsumerTest.java index b04ba21..2e6d49e 100644 --- a/aai-resources/src/test/java/org/onap/aai/rest/URLFromVertexIdConsumerTest.java +++ b/aai-resources/src/test/java/org/onap/aai/rest/URLFromVertexIdConsumerTest.java @@ -139,8 +139,8 @@ public class URLFromVertexIdConsumerTest extends AAISetup { when(uriInfo.getPath(false)).thenReturn(uri); MockHttpServletRequest mockReqGet = new MockHttpServletRequest("GET", uri); - Response response = legacyMoxyConsumer.getLegacy("", "-1", "-1", schemaVersions.getDefaultVersion().toString(), - uri, "all", "false", httpHeaders, uriInfo, mockReqGet); + Response response = legacyMoxyConsumer.getLegacy(schemaVersions.getDefaultVersion().toString(), uri, -1, -1, false, + "all", "false", httpHeaders, uriInfo, mockReqGet); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); MockHttpServletRequest mockReq = new MockHttpServletRequest("PUT", uri); diff --git a/aai-resources/src/test/java/org/onap/aai/rest/VertexIdConsumerTest.java b/aai-resources/src/test/java/org/onap/aai/rest/VertexIdConsumerTest.java index 0f56348..ce9a423 100644 --- a/aai-resources/src/test/java/org/onap/aai/rest/VertexIdConsumerTest.java +++ b/aai-resources/src/test/java/org/onap/aai/rest/VertexIdConsumerTest.java @@ -139,8 +139,8 @@ public class VertexIdConsumerTest extends AAISetup { when(uriInfo.getPath(false)).thenReturn(uri); MockHttpServletRequest mockReqGet = new MockHttpServletRequest("GET", uri); - Response response = legacyMoxyConsumer.getLegacy("", "-1", "-1", schemaVersions.getDefaultVersion().toString(), - uri, "all", "false", httpHeaders, uriInfo, mockReqGet); + Response response = legacyMoxyConsumer.getLegacy(schemaVersions.getDefaultVersion().toString(), uri, -1, -1, + false, "all", "false", httpHeaders, uriInfo, mockReqGet); assertEquals(Response.Status.NOT_FOUND.getStatusCode(), response.getStatus()); MockHttpServletRequest mockReq = new MockHttpServletRequest("PUT", uri); diff --git a/pom.xml b/pom.xml index e4629bc..b25b5d5 100644 --- a/pom.xml +++ b/pom.xml @@ -26,11 +26,11 @@ org.onap.aai.aai-common aai-parent - 1.14.2-SNAPSHOT + 1.14.3-SNAPSHOT org.onap.aai.resources resources - 1.14.2-SNAPSHOT + 1.14.3-SNAPSHOT aai-resources pom @@ -48,7 +48,7 @@ /content/repositories/staging/ ${project.version} - 1.14.2 + 1.14.3-SNAPSHOT 1.12.4 -- cgit 1.2.3-korg