diff --git a/CHANGELOG.md b/CHANGELOG.md index da22f0b4..7fed5786 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ +## 0.9.7 +- Added more information in error messages for generate service +- Uplifted semantics version to 0.4.0 + ## 0.9.6 - Added swagger for generate service - Added more verifications for generate service diff --git a/README.md b/README.md index 17b6088a..4c2efafb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# eiffel-remrem-generate +# Eiffel REMReM Generate + [![Build Status](https://travis-ci.org/Ericsson/eiffel-remrem-generate.svg?branch=master)](https://travis-ci.org/Ericsson/eiffel-remrem-generate) [![Coverage Status](https://coveralls.io/repos/github/Ericsson/eiffel-remrem-generate/badge.svg?branch=master)](https://coveralls.io/github/Ericsson/eiffel-remrem-generate?branch=master) [![](https://jitpack.io/v/Ericsson/eiffel-remrem-generate.svg)](https://jitpack.io/#Ericsson/eiffel-remrem-generate) @@ -6,4 +7,4 @@ ## Documentation Further documentation is provided at the following link: [http://ericsson.github.io/eiffel-remrem-generate/](http://ericsson.github.io/eiffel-remrem-generate/). -__IMPORTANT NOTICE:__ The contents of this repository currectly reflect a __DRAFT__. The Eiffel framework has been used in production within Ericsson for several years to great effect; what is presented here is a revision and evolution of that framework - an evolution that is currently ongoing. In other words, anything in this repository should be regarded as tentative and subject to change. It is published here to allow early access and trial and to solicit early feedback. +__IMPORTANT NOTICE:__ The contents of this repository currently reflect a __DRAFT__. The Eiffel framework has been used in production within Ericsson for several years to great effect; what is presented here is a revision and evolution of that framework - an evolution that is currently ongoing. In other words, anything in this repository should be regarded as tentative and subject to change. It is published here to allow early access and trial and to solicit early feedback. diff --git a/build.gradle b/build.gradle index 93a38551..20a6f3db 100644 --- a/build.gradle +++ b/build.gradle @@ -53,7 +53,7 @@ subprojects { targetCompatibility = 1.8 //Latest version for generate - version = "0.9.6" + version = "0.9.7" repositories { mavenCentral() @@ -64,7 +64,7 @@ subprojects { dependencies { //Injectable Message Library and its Implementation compile("com.github.Ericsson:eiffel-remrem-shared:0.3.5") - compile("com.github.Ericsson:eiffel-remrem-semantics:0.3.8") + compile("com.github.Ericsson:eiffel-remrem-semantics:0.4.0") compile("com.github.Ericsson:eiffel-remrem-protocol-interface:0.0.7") //Authentication diff --git a/service/src/integration-test/java/com/ericsson/eiffel/remrem/generate/EiffelRemremControllerIntegrationTest.java b/service/src/integration-test/java/com/ericsson/eiffel/remrem/generate/EiffelRemremControllerIntegrationTest.java index 3fac060a..8a952de1 100644 --- a/service/src/integration-test/java/com/ericsson/eiffel/remrem/generate/EiffelRemremControllerIntegrationTest.java +++ b/service/src/integration-test/java/com/ericsson/eiffel/remrem/generate/EiffelRemremControllerIntegrationTest.java @@ -57,7 +57,7 @@ public class EiffelRemremControllerIntegrationTest { private String activityFinishedDuplicateKeysFileName = "ActivityFinishedEventDuplicatedKeys.json"; private String activityFinishedDuplicateKeysBody; - private String version = "1.0.0"; + private String version = "1.1.0"; private String credentials = "Basic " + Base64.getEncoder().encodeToString("user:secret".getBytes()); diff --git a/service/src/integration-test/resources/ActivityFinished.json b/service/src/integration-test/resources/ActivityFinished.json index 028184f3..5c586650 100644 --- a/service/src/integration-test/resources/ActivityFinished.json +++ b/service/src/integration-test/resources/ActivityFinished.json @@ -2,7 +2,7 @@ "msgParams": { "meta": { "type": "EiffelActivityFinishedEvent", - "version": "1.0.0", + "version": "1.1.0", "tags": [ "tag1", "tag2" diff --git a/service/src/integration-test/resources/ActivityFinishedEventDuplicatedKeys.json b/service/src/integration-test/resources/ActivityFinishedEventDuplicatedKeys.json index f31ed5be..52c52824 100644 --- a/service/src/integration-test/resources/ActivityFinishedEventDuplicatedKeys.json +++ b/service/src/integration-test/resources/ActivityFinishedEventDuplicatedKeys.json @@ -2,7 +2,7 @@ "msgParams": { "meta": { "type": "EiffelActivityFinishedEvent", - "version": "1.0.0", + "version": "1.1.0", "tags": [ "tag1", "tag2" diff --git a/service/src/integration-test/resources/ArtifactPublished.json b/service/src/integration-test/resources/ArtifactPublished.json index 2483dd76..86a3720e 100644 --- a/service/src/integration-test/resources/ArtifactPublished.json +++ b/service/src/integration-test/resources/ArtifactPublished.json @@ -2,7 +2,7 @@ "msgParams": { "meta": { "type": "EiffelArtifactPublishedEvent", - "version": "1.0.0", + "version": "1.1.0", "tags": [ "tag1", "tag2" diff --git a/service/src/main/java/com/ericsson/eiffel/remrem/generate/constants/RemremGenerateServiceConstants.java b/service/src/main/java/com/ericsson/eiffel/remrem/generate/constants/RemremGenerateServiceConstants.java index b1a5d885..c6539352 100644 --- a/service/src/main/java/com/ericsson/eiffel/remrem/generate/constants/RemremGenerateServiceConstants.java +++ b/service/src/main/java/com/ericsson/eiffel/remrem/generate/constants/RemremGenerateServiceConstants.java @@ -16,9 +16,15 @@ public final class RemremGenerateServiceConstants { - public static final String NO_SERVICE_ERROR = "{\"message\":\"No protocol service has been found registered.\"}"; - public static final String NO_TEMPLATE_ERROR = "{\"message\":\"Requested template is not available.\"}"; - public static final String INTERNAL_SERVER_ERROR = "{\"message\":\"Internal server error.\"}"; + public static final String NO_SERVICE_ERROR = "{\"status_code\": 503, \"result\": \"FAIL\", " + + "\"message\":\"No protocol service has been found registered\"}"; + + public static final String NO_TEMPLATE_ERROR = "{\"status_code\": 404, \"result\": \"FAIL\", " + + "\"message\":\"Requested template is not available\"}"; + + public static final String INTERNAL_SERVER_ERROR = "{\"status_code\": 500, \"result\": \"FAIL\", " + + "\"message\":\"Internal server error\"}"; + public static final String JSON_ERROR_MESSAGE_FIELD = "message"; public static final String DOCUMENTATION_URL = "http://ericsson.github.io/eiffel-remrem-generate/index.html"; diff --git a/service/src/main/java/com/ericsson/eiffel/remrem/generate/controller/RemremGenerateController.java b/service/src/main/java/com/ericsson/eiffel/remrem/generate/controller/RemremGenerateController.java index 9570be4e..3f0ba064 100644 --- a/service/src/main/java/com/ericsson/eiffel/remrem/generate/controller/RemremGenerateController.java +++ b/service/src/main/java/com/ericsson/eiffel/remrem/generate/controller/RemremGenerateController.java @@ -90,7 +90,7 @@ public ResponseEntity generate(@ApiParam(value = "message protocol", required HttpStatus.SERVICE_UNAVAILABLE); } } catch (Exception e) { - return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR); + return new ResponseEntity<>(parser.parse(RemremGenerateServiceConstants.INTERNAL_SERVER_ERROR), HttpStatus.INTERNAL_SERVER_ERROR); } }