diff options
Diffstat (limited to 'aai-resources/src')
4 files changed, 15 insertions, 5 deletions
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 c685071..4912a00 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 @@ -290,9 +290,8 @@ public class LegacyMoxyConsumer extends RESTAPI { Introspector obj = loader.introspectorFromName(objType); DBRequest request = new DBRequest.Builder(HttpMethod.GET, uriObject, uriQuery, obj, headers, info, transId).build(); - List<DBRequest> requests = new ArrayList<>(); - requests.add(request); - if (resultIndex != null && !"-1".equals(resultIndex) && resultSize != null && !"-1".equals(resultSize)) { + List<DBRequest> requests = Collections.singletonList(request); + if (hasValidPaginationParams(resultIndex, resultSize)) { traversalUriHttpEntry.setPaginationIndex(Integer.parseInt(resultIndex)); traversalUriHttpEntry.setPaginationBucket(Integer.parseInt(resultSize)); } @@ -320,6 +319,10 @@ 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 MultivaluedMap<String, String> removeNonFilterableParams(MultivaluedMap<String, String> params) { String[] toRemove = @@ -554,7 +557,7 @@ public class LegacyMoxyConsumer extends RESTAPI { .build(); List<DBRequest> requests = new ArrayList<>(); requests.add(request); - if (resultIndex != null && !"-1".equals(resultIndex) && resultSize != null && !"-1".equals(resultSize)) { + if (hasValidPaginationParams(resultIndex, resultSize)) { traversalUriHttpEntry.setPaginationIndex(Integer.parseInt(resultIndex)); traversalUriHttpEntry.setPaginationBucket(Integer.parseInt(resultSize)); } diff --git a/aai-resources/src/main/resources/application.properties b/aai-resources/src/main/resources/application.properties index 094c81c..0389406 100644 --- a/aai-resources/src/main/resources/application.properties +++ b/aai-resources/src/main/resources/application.properties @@ -7,6 +7,8 @@ info.build.version=1.1.0 spring.application.name=aai-resources spring.jersey.type=filter spring.main.allow-bean-definition-overriding=true + +spring.sleuth.enabled=true spring.zipkin.baseUrl=http://jaeger-collector.istio-system:9411 spring.sleuth.messaging.jms.enabled = false spring.sleuth.trace-id128=true diff --git a/aai-resources/src/test/resources/application-test.properties b/aai-resources/src/test/resources/application-test.properties index cdc528f..596bd23 100644 --- a/aai-resources/src/test/resources/application-test.properties +++ b/aai-resources/src/test/resources/application-test.properties @@ -11,6 +11,8 @@ server.servlet.context-path=/ spring.jersey.application-path=${schema.uri.base.path} +spring.sleuth.enabled=false + spring.autoconfigure.exclude=\ org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,\ org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,\ diff --git a/aai-resources/src/test/resources/logback.xml b/aai-resources/src/test/resources/logback.xml index 4504bce..8bb9e7c 100644 --- a/aai-resources/src/test/resources/logback.xml +++ b/aai-resources/src/test/resources/logback.xml @@ -223,11 +223,14 @@ <logger name="org.zookeeper" level="OFF" /> - <logger name="org.onap.aai" level="DEBUG" additivity="false"> + <logger name="org.onap.aai" level="INFO" additivity="false"> <appender-ref ref="asyncDEBUG" /> <appender-ref ref="asyncSANE" /> <appender-ref ref="STDOUT" /> </logger> + <logger name="org.onap.aai.dbgen" level="WARN" additivity="false"> + <appender-ref ref="STDOUT" /> + </logger> <logger name="org.onap.aai.aailog.logs.AaiScheduledTaskAuditLog" level="INFO"> <appender-ref ref="asyncAUDIT"/> </logger> |