diff --git a/NOTICE b/NOTICE index 7c18c243f76ab90d6d670b0d8d736b223eecf0d9..bfa4ec81ac4ad7afdc45db390a9d793157014176 100644 --- a/NOTICE +++ b/NOTICE @@ -72,7 +72,6 @@ The following software have components provided under the terms of this license: - Asynchronous Http Client (from https://repo1.maven.org/maven2/org/asynchttpclient/async-http-client) - Asynchronous Http Client Netty Utils (from https://repo1.maven.org/maven2/org/asynchttpclient/async-http-client-netty-utils) - AutoValue Annotations (from https://github.com/google/auto/tree/master/value, https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations) -- AutoValue Processor (from https://github.com/google/auto/tree/master/value) - BSON (from http://bsonspec.org, https://bsonspec.org) - BSON Record Codec (from <https://www.mongodb.com/>, https://www.mongodb.com/) - Bean Validation API (from http://beanvalidation.org) @@ -82,25 +81,18 @@ The following software have components provided under the terms of this license: - Byte Buddy (without dependencies) (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy) - Byte Buddy Java agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent) - ClassMate (from http://github.com/cowtowncoder/java-classmate) -- Cloud Key Management Service (KMS) API (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms) -- Cloud Storage JSON API v1-rev20230301-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage) +- Cloud Key Management Service (KMS) API v1-rev20230407-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms) - Collections (from https://repo1.maven.org/maven2/commons-collections/commons-collections) - Commons Digester (from http://commons.apache.org/digester/) - Converter: Jackson (from https://github.com/square/retrofit, https://repo1.maven.org/maven2/com/squareup/retrofit2/converter-jackson) - Core functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty) - FindBugs-jsr305 (from http://findbugs.sourceforge.net/) -- GAX (Google Api eXtensions) for Java (HTTP JSON) (from <https://repo1.maven.org/maven2/com/google/api/gax-httpjson>, https://repo1.maven.org/maven2/com/google/api/gax-httpjson) - GSON extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-gson) - Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client) -- Google App Engine extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-appengine) - Google Cloud Core (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core, https://github.com/googleapis/java-core, https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core) -- Google Cloud Core HTTP (from https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-core-http, https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-http, https://github.com/googleapis/java-core, https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core-http) - Google Cloud Core gRPC (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-core-grpc, https://github.com/googleapis/java-core, https://repo1.maven.org/maven2/com/google/cloud/google-cloud-core-grpc) -- Google Cloud Datastore (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-datastore, https://github.com/googleapis/java-datastore) -- Google Cloud IAM Service Account Credentials (from https://github.com/googleapis/google-cloud-java, https://github.com/googleapis/java-iamcredentials) - Google Cloud Logging (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-logging, https://github.com/googleapis/java-logging) - Google Cloud Pub/Sub (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-pubsub, https://github.com/googleapis/java-pubsub) -- Google Cloud Storage (from https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-storage, https://github.com/googleapis/java-storage) - Google HTTP Client Library for Java (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client) - Google OAuth Client Library for Java (from https://repo1.maven.org/maven2/com/google/oauth-client/google-oauth-client) - Gson (from http://code.google.com/p/google-gson/, https://repo1.maven.org/maven2/com/google/code/gson/gson) @@ -110,7 +102,6 @@ The following software have components provided under the terms of this license: - HTTP functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty) - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - Hibernate Validator (from https://repo1.maven.org/maven2/org/hibernate/hibernate-validator, https://repo1.maven.org/maven2/org/hibernate/validator/hibernate-validator) -- HikariCP (from https://github.com/brettwooldridge/HikariCP) - Hop (from https://github.com/rabbitmq/hop, https://www.rabbitmq.com) - IBM COS Java SDK for Amazon S3 (from https://github.com/ibm/ibm-cos-sdk-java) - IBM COS Java SDK for COS KMS (from https://github.com/ibm/ibm-cos-sdk-java) @@ -129,6 +120,7 @@ The following software have components provided under the terms of this license: - JSON library from Android SDK (from http://developer.android.com/sdk) - JSONassert (from http://github.com/skyscreamer/yoga, https://github.com/skyscreamer/JSONassert) - JSR107 API and SPI (from https://github.com/jsr107/jsr107spec) +- Jackson 2 extensions to the Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client-jackson2) - Jackson 2 extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-jackson2) - Jackson dataformat: CBOR (from http://github.com/FasterXML/jackson-dataformats-binary) - Jackson datatype: JSR310 (from http://wiki.fasterxml.com/JacksonModuleJSR310, https://repo1.maven.org/maven2/com/fasterxml/jackson/datatype/jackson-datatype-jsr310) @@ -175,7 +167,6 @@ The following software have components provided under the terms of this license: - Mockito (from http://mockito.org, http://www.mockito.org, https://github.com/mockito/mockito) - MongoDB Driver (from https://www.mongodb.com/) - MongoDB Java Driver (from http://mongodb.org/, http://www.mongodb.org, https://www.mongodb.com/) -- NanoHttpd-Core (from https://repo1.maven.org/maven2/org/nanohttpd/nanohttpd) - Netty Reactive Streams Implementation (from https://repo1.maven.org/maven2/com/typesafe/netty/netty-reactive-streams) - Netty/Buffer (from https://repo1.maven.org/maven2/io/netty/netty-buffer) - Netty/Codec (from https://repo1.maven.org/maven2/io/netty/netty-codec) @@ -190,8 +181,6 @@ The following software have components provided under the terms of this license: - Netty/Resolver (from https://repo1.maven.org/maven2/io/netty/netty-resolver) - Netty/Resolver/DNS (from https://repo1.maven.org/maven2/io/netty/netty-resolver-dns) - Netty/Resolver/DNS/Classes/MacOS (from https://repo1.maven.org/maven2/io/netty/netty-resolver-dns-classes-macos) -- Netty/TomcatNative [BoringSSL - Static] (from https://github.com/netty/netty-tcnative/netty-tcnative-boringssl-static/) -- Netty/TomcatNative [OpenSSL - Classes] (from https://repo1.maven.org/maven2/io/netty/netty-tcnative-classes) - Netty/Transport (from https://repo1.maven.org/maven2/io/netty/netty-transport) - Netty/Transport/Classes/Epoll (from https://repo1.maven.org/maven2/io/netty/netty-transport-classes-epoll) - Netty/Transport/Classes/KQueue (from https://repo1.maven.org/maven2/io/netty/netty-transport-classes-kqueue) @@ -206,16 +195,14 @@ The following software have components provided under the terms of this license: - OkHttp Logging Interceptor (from https://github.com/square/okhttp, https://repo1.maven.org/maven2/com/squareup/okhttp3/logging-interceptor, https://square.github.io/okhttp/) - OkHttp URLConnection (from https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp-urlconnection, https://square.github.io/okhttp/) - Okio (from https://github.com/square/okio/, https://repo1.maven.org/maven2/com/squareup/okio/okio) -- OpenCensus (from https://github.com/census-instrumentation/opencensus-java, https://github.com/census-instrumentation/opencensus-proto) +- OpenCensus (from https://github.com/census-instrumentation/opencensus-java) - PWDB :: Database (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/database) -- PostgreSQL JDBC Driver - PowerMock (from http://www.powermock.org, https://repo1.maven.org/maven2/org/powermock/powermock-api-mockito) - Prometheus Java Simpleclient (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient>, https://repo1.maven.org/maven2/io/prometheus/simpleclient) - Prometheus Java Simpleclient Common (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_common>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_common) - Prometheus Java Span Context Supplier - Common (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_common>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_common) - Prometheus Java Span Context Supplier - OpenTelemetry (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel) - Prometheus Java Span Context Supplier - OpenTelemetry Agent (from <https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel_agent>, https://repo1.maven.org/maven2/io/prometheus/simpleclient_tracer_otel_agent) -- Protocol Buffer extensions to the Google HTTP Client Library for Java. (from https://repo1.maven.org/maven2/com/google/http-client/google-http-client-protobuf) - Proton-J (from https://repo1.maven.org/maven2/org/apache/qpid/proton-j) - QUIC functionality for the Reactor Netty library (from https://github.com/reactor/reactor-netty) - QpidJMS Client (from https://repo1.maven.org/maven2/org/apache/qpid/qpid-jms-client) @@ -224,7 +211,6 @@ The following software have components provided under the terms of this license: - Redisson (from http://redisson.org) - Retrofit (from https://github.com/square/retrofit, https://repo1.maven.org/maven2/com/squareup/retrofit2/retrofit) - RxJava (from https://github.com/ReactiveX/RxJava) -- Simple XML (safe) (from https://github.com/dweiss/simplexml) - SnakeYAML (from http://code.google.com/p/snakeyaml/, http://www.snakeyaml.org, https://bitbucket.org/snakeyaml/snakeyaml) - Spring AOP (from http://www.springframework.org, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-aop) - Spring Beans (from http://www.springframework.org, https://github.com/SpringSource/spring-framework, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-beans) @@ -235,7 +221,6 @@ The following software have components provided under the terms of this license: - Spring Boot Actuator Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) - Spring Boot AutoConfigure (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-autoconfigure, https://spring.io/projects/spring-boot) - Spring Boot Dependencies (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) -- Spring Boot JDBC Starter (from http://projects.spring.io/spring-boot/, https://spring.io/projects/spring-boot) - Spring Boot Json Starter (from https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json, https://spring.io/projects/spring-boot) - Spring Boot Log4j 2 Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-log4j2, https://spring.io/projects/spring-boot) - Spring Boot Logging Starter (from http://projects.spring.io/spring-boot/, https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-logging, https://spring.io/projects/spring-boot) @@ -255,7 +240,6 @@ The following software have components provided under the terms of this license: - Spring Data Core (from https://spring.io/projects/spring-data) - Spring Data MongoDB - Core (from https://repo1.maven.org/maven2/org/springframework/data/spring-data-mongodb) - Spring Expression Language (SpEL) (from https://github.com/SpringSource/spring-framework, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-expression) -- Spring JDBC (from https://github.com/SpringSource/spring-framework, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-jdbc) - Spring JMS (from http://www.springframework.org, https://github.com/SpringSource/spring-framework, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-jms) - Spring Messaging (from https://github.com/spring-projects/spring-framework) - Spring Plugin - Metadata Extension (from https://repo1.maven.org/maven2/org/springframework/plugin/spring-plugin-metadata) @@ -282,23 +266,18 @@ The following software have components provided under the terms of this license: - Zipkin Reporter: Core (from https://repo1.maven.org/maven2/io/zipkin/reporter2/zipkin-reporter) - Zipkin v2 (from https://repo1.maven.org/maven2/io/zipkin/zipkin2/zipkin) - aalto-xml (from https://github.com/FasterXML/aalto-xml, https://repo1.maven.org/maven2/com/fasterxml/aalto-xml) -- datastore-v1-proto-client (from https://repo1.maven.org/maven2/com/google/cloud/datastore/datastore-v1-proto-client) - documentdb-bulkexecutor (from http://azure.microsoft.com/en-us/services/documentdb/) - error-prone annotations (from https://repo1.maven.org/maven2/com/google/errorprone/error_prone_annotations) -- grpc-google-cloud-datastore-admin-v1 (from https://github.com/googleapis/java-datastore/grpc-google-cloud-datastore-admin-v1) - io.grpc:grpc-alts (from https://github.com/grpc/grpc-java) - io.grpc:grpc-api (from https://github.com/grpc/grpc-java) - io.grpc:grpc-auth (from https://github.com/grpc/grpc-java) - io.grpc:grpc-context (from https://github.com/grpc/grpc-java) - io.grpc:grpc-core (from https://github.com/grpc/grpc-java) -- io.grpc:grpc-googleapis (from https://github.com/grpc/grpc-java) - io.grpc:grpc-grpclb (from https://github.com/grpc/grpc-java) - io.grpc:grpc-netty-shaded (from https://github.com/grpc/grpc-java) - io.grpc:grpc-protobuf (from https://github.com/grpc/grpc-java) - io.grpc:grpc-protobuf-lite (from https://github.com/grpc/grpc-java) -- io.grpc:grpc-services (from https://github.com/grpc/grpc-java) - io.grpc:grpc-stub (from https://github.com/grpc/grpc-java) -- io.grpc:grpc-xds (from https://github.com/grpc/grpc-java) - ion-java (from https://github.com/amzn/ion-java/, https://github.com/amznlabs/ion-java/) - jackson-databind (from http://github.com/FasterXML/jackson, http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson) - java-cloudant (from https://cloudant.com) @@ -311,15 +290,11 @@ The following software have components provided under the terms of this license: - micrometer-core (from https://github.com/micrometer-metrics/micrometer) - micrometer-registry-azure-monitor (from https://github.com/micrometer-metrics/micrometer) - micrometer-registry-prometheus (from <https://github.com/micrometer-metrics/micrometer>, https://github.com/micrometer-metrics/micrometer) -- minio (from https://github.com/minio/minio-java) - org.apiguardian:apiguardian-api (from https://github.com/apiguardian-team/apiguardian) - org.conscrypt:conscrypt-openjdk-uber (from https://conscrypt.org/) - org.opentest4j:opentest4j (from https://github.com/ota4j-team/opentest4j) - org.xmlunit:xmlunit-core (from http://www.xmlunit.org/, https://www.xmlunit.org/) - perfmark:perfmark-api (from https://github.com/perfmark/perfmark) -- proto-google-cloud-datastore-admin-v1 (from https://github.com/googleapis/java-datastore/proto-google-cloud-datastore-admin-v1) -- proto-google-cloud-datastore-v1 (from https://github.com/googleapis/googleapis, https://github.com/googleapis/java-datastore/proto-google-cloud-datastore-v1) -- proto-google-cloud-iamcredentials-v1 (from https://github.com/googleapis/google-cloud-java, https://github.com/googleapis/java-iamcredentials/proto-google-cloud-iamcredentials-v1, https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-cloud-iamcredentials-v1) - proto-google-cloud-logging-v2 (from https://github.com/googleapis/java-logging/proto-google-cloud-logging-v2, https://repo1.maven.org/maven2/com/google/api/grpc/proto-google-cloud-logging-v2) - proto-google-cloud-pubsub-v1 (from https://github.com/googleapis/googleapis, https://github.com/googleapis/java-pubsub/proto-google-cloud-pubsub-v1) - proto-google-common-protos (from https://github.com/googleapis/api-client-staging, https://github.com/googleapis/gapic-generator-java, https://github.com/googleapis/googleapis, https://github.com/googleapis/java-iam/proto-google-common-protos) @@ -351,7 +326,6 @@ The following software have components provided under the terms of this license: - HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/) - Jodd BeanUtil (from http://jodd.org) - Jodd Core (from http://jodd.org) -- PostgreSQL JDBC Driver - Stax2 API (from http://github.com/FasterXML/stax2-api) ======================================================================== @@ -363,7 +337,6 @@ The following software have components provided under the terms of this license: - ASM Core (from http://asm.ow2.io/, http://asm.ow2.org/) - AspectJ Weaver (from http://www.aspectj.org, https://www.eclipse.org/aspectj/) - GAX (Google Api eXtensions) for Java (Core) (from https://github.com/googleapis, https://github.com/googleapis/gax-java, https://repo1.maven.org/maven2/com/google/api/gax) -- GAX (Google Api eXtensions) for Java (HTTP JSON) (from <https://repo1.maven.org/maven2/com/google/api/gax-httpjson>, https://repo1.maven.org/maven2/com/google/api/gax-httpjson) - GAX (Google Api eXtensions) for Java (gRPC) (from <https://repo1.maven.org/maven2/com/google/api/gax-grpc>, https://repo1.maven.org/maven2/com/google/api/gax-grpc) - Google APIs Client Library for Java (from https://repo1.maven.org/maven2/com/google/api-client/google-api-client) - Google Auth Library for Java - Credentials (from https://repo1.maven.org/maven2/com/google/auth/google-auth-library-credentials) @@ -382,12 +355,9 @@ The following software have components provided under the terms of this license: - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) - Mockito (from http://mockito.org, http://www.mockito.org, https://github.com/mockito/mockito) -- NanoHttpd-Core (from https://repo1.maven.org/maven2/org/nanohttpd/nanohttpd) - Netty/Codec/HTTP (from https://repo1.maven.org/maven2/io/netty/netty-codec-http) -- PostgreSQL JDBC Driver - Protocol Buffer Java API (from http://code.google.com/p/protobuf, https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java) - Protocol Buffers [Util] (from https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java-util) -- RE2/J (from http://github.com/google/re2j) - Redisson (from http://redisson.org) - Spring Core (from http://www.springframework.org, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-core) - ThreeTen backport (from https://github.com/ThreeTen/threetenbp, https://www.threeten.org/threetenbp) @@ -409,13 +379,6 @@ The following software have components provided under the terms of this license: - Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java) - Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java) -======================================================================== -BouncyCastle -======================================================================== -The following software have components provided under the terms of this license: - -- Bouncy Castle Provider (from http://www.bouncycastle.org/java.html, https://www.bouncycastle.org/java.html) - ======================================================================== CC-BY-2.5 ======================================================================== @@ -595,8 +558,6 @@ LGPL-2.1-only ======================================================================== The following software have components provided under the terms of this license: -- Java Native Access (from https://github.com/java-native-access/jna, https://github.com/twall/jna) -- Java Native Access Platform (from https://github.com/java-native-access/jna) - Logback Classic Module (from http://logback.qos.ch, https://repo1.maven.org/maven2/ch/qos/logback/logback-classic) - Logback Contrib :: JSON :: Classic (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-classic) - Logback Contrib :: JSON :: Core (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-core) @@ -634,7 +595,6 @@ The following software have components provided under the terms of this license: - Azure Java Client Runtime for AutoRest (from https://github.com/Azure/autorest-clientruntime-for-java) - Azure Spring Boot AutoConfigure (from https://github.com/Azure/azure-sdk-for-java, https://github.com/Microsoft/azure-spring-boot) - Azure Spring Boot Starter for Azure AD Spring Security Integration (from https://github.com/Azure/azure-sdk-for-java) -- Bouncy Castle Provider (from http://www.bouncycastle.org/java.html, https://www.bouncycastle.org/java.html) - Checker Qual (from https://checkerframework.org) - ClassGraph (from https://github.com/classgraph/classgraph) - JUL to SLF4J bridge (from http://www.slf4j.org) @@ -757,7 +717,6 @@ The following software have components provided under the terms of this license: - JSON in Java (from https://github.com/douglascrockford/JSON-java) - LatencyUtils (from http://latencyutils.github.io/LatencyUtils/) - Microsoft Azure client library for Blob Storage (from https://github.com/Azure/azure-sdk-for-java) -- PostgreSQL JDBC Driver - Undertow Core (from <https://repo1.maven.org/maven2/io/undertow/undertow-core>, https://repo1.maven.org/maven2/io/undertow/undertow-core) - Undertow Servlet (from <https://repo1.maven.org/maven2/io/undertow/undertow-servlet>, https://repo1.maven.org/maven2/io/undertow/undertow-servlet) - Undertow WebSockets JSR356 implementations (from <https://repo1.maven.org/maven2/io/undertow/undertow-websockets-jsr>, https://repo1.maven.org/maven2/io/undertow/undertow-websockets-jsr) diff --git a/notification-core/src/main/java/org/opengroup/osdu/notification/api/GlobalErrorController.java b/notification-core/src/main/java/org/opengroup/osdu/notification/api/GlobalErrorController.java index 52aa9b1da5f6ce07d90443c00a6f5f04e0f7d540..ba530936f435d5f916fef9bcb581b6168d329cb2 100644 --- a/notification-core/src/main/java/org/opengroup/osdu/notification/api/GlobalErrorController.java +++ b/notification-core/src/main/java/org/opengroup/osdu/notification/api/GlobalErrorController.java @@ -76,7 +76,7 @@ public class GlobalErrorController implements ErrorController { err = exception == null ? "An unknown error has occurred" : exception.getMessage(); } - return String.format("{\"code\": %s, \"reason:\": \"%s\" \"message\":\"%s\" }", + return String.format("{\"code\": %s, \"reason\": \"%s\", \"message\":\"%s\"}", statusCode, HttpStatus.resolve(statusCode).getReasonPhrase(), err); } diff --git a/notification-core/src/test/java/org/opengroup/osdu/notification/api/GlobalErrorControllerTest.java b/notification-core/src/test/java/org/opengroup/osdu/notification/api/GlobalErrorControllerTest.java index 6c4570a42587a93a1fcaf22703c41c44588e6bc7..bb90755de04a7c7f69d47a16031bf35dd6df7aa3 100644 --- a/notification-core/src/test/java/org/opengroup/osdu/notification/api/GlobalErrorControllerTest.java +++ b/notification-core/src/test/java/org/opengroup/osdu/notification/api/GlobalErrorControllerTest.java @@ -47,35 +47,35 @@ public class GlobalErrorControllerTest { public void handleErrorGetTest() { when(httpServletRequest.getAttribute(eq("javax.servlet.error.status_code"))).thenReturn(500); String expected = globalErrorController.handleErrorGet(httpServletRequest); - assertEquals(expected, "{\"code\": 500, \"reason:\": \"Internal Server Error\" \"message\":\"An unknown error has occurred\" }"); + assertEquals(expected, "{\"code\": 500, \"reason\": \"Internal Server Error\", \"message\":\"An unknown error has occurred\"}"); } @Test public void handleErrorPutTest() { when(httpServletRequest.getAttribute(eq("javax.servlet.error.status_code"))).thenReturn(404); String expected = globalErrorController.handleErrorPut(httpServletRequest); - assertEquals(expected, "{\"code\": 404, \"reason:\": \"Not Found\" \"message\":\"sample exception\" }"); + assertEquals(expected, "{\"code\": 404, \"reason\": \"Not Found\", \"message\":\"sample exception\"}"); } @Test public void handleErrorPatchTest() { when(httpServletRequest.getAttribute(eq("javax.servlet.error.status_code"))).thenReturn(500); String expected = globalErrorController.handleErrorPatch(httpServletRequest); - assertEquals(expected, "{\"code\": 500, \"reason:\": \"Internal Server Error\" \"message\":\"An unknown error has occurred\" }"); + assertEquals(expected, "{\"code\": 500, \"reason\": \"Internal Server Error\", \"message\":\"An unknown error has occurred\"}"); } @Test public void handleErrorDeleteTest() { when(httpServletRequest.getAttribute(eq("javax.servlet.error.status_code"))).thenReturn(500); String expected = globalErrorController.handleErrorDelete(httpServletRequest); - assertEquals(expected, "{\"code\": 500, \"reason:\": \"Internal Server Error\" \"message\":\"An unknown error has occurred\" }"); + assertEquals(expected, "{\"code\": 500, \"reason\": \"Internal Server Error\", \"message\":\"An unknown error has occurred\"}"); } @Test public void handleErrorPostTest() { when(httpServletRequest.getAttribute(eq("javax.servlet.error.status_code"))).thenReturn(500); String expected = globalErrorController.handleErrorPost(httpServletRequest); - assertEquals(expected, "{\"code\": 500, \"reason:\": \"Internal Server Error\" \"message\":\"An unknown error has occurred\" }"); + assertEquals(expected, "{\"code\": 500, \"reason\": \"Internal Server Error\", \"message\":\"An unknown error has occurred\"}"); } @Test