Skip to content

Commit dbb2ed3

Browse files
Modified generate's endpoint generate to accept array of events
1 parent 962cabb commit dbb2ed3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

service/src/main/java/com/ericsson/eiffel/remrem/generate/controller/RemremGenerateController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public ResponseEntity<?> generate(final String msgProtocol, final String msgType
215215
*/
216216
public ResponseEntity<JsonObject> createResponseEntity(HttpStatus status, String responseMessage, String resultMessage,
217217
JsonObject errorResponse) {
218-
initializeResponse(status, responseMessage, resultMessage, errorResponse);
218+
initializeResponse(status, resultMessage, responseMessage, errorResponse);
219219
return new ResponseEntity<>(errorResponse, status);
220220
}
221221

@@ -226,7 +226,7 @@ public ResponseEntity<JsonObject> createResponseEntity(HttpStatus status, String
226226
* @param resultMessage whatever the result this message gives you idea about that
227227
* @return ResponseEntity
228228
*/
229-
public ResponseEntity<JsonObject> createResponseEntity(HttpStatus status, String responseMessage, String resultMessage) {
229+
public ResponseEntity<JsonObject> createResponseEntity(HttpStatus status, String resultMessage, String responseMessage) {
230230
return createResponseEntity(status, responseMessage, resultMessage, new JsonObject());
231231
}
232232

@@ -236,7 +236,7 @@ public ResponseEntity<JsonObject> createResponseEntity(HttpStatus status, String
236236
* @param resultMessage whatever the result this message gives you idea about that
237237
* @param errorResponse is to collect all the responses here.
238238
*/
239-
public void initializeResponse(HttpStatus status, String errorMessage, String resultMessage, JsonObject errorResponse) {
239+
public void initializeResponse(HttpStatus status, String resultMessage, String errorMessage, JsonObject errorResponse) {
240240
errorResponse.addProperty(JSON_STATUS_CODE, status.value());
241241
errorResponse.addProperty(JSON_STATUS_RESULT, resultMessage);
242242
errorResponse.addProperty(JSON_ERROR_MESSAGE_FIELD, errorMessage);
@@ -299,7 +299,7 @@ public JsonObject processEvent(String msgProtocol, String msgType, Boolean failI
299299

300300
if (parsedJson.has(JSON_ERROR_MESSAGE_FIELD)) {
301301
JsonObject eventResponse = new JsonObject();
302-
createResponseEntity(HttpStatus.BAD_REQUEST, JSON_ERROR_STATUS, TEMPLATE_ERROR, eventResponse);
302+
createResponseEntity(HttpStatus.BAD_REQUEST, parsedJson.toString(), JSON_ERROR_STATUS, eventResponse);
303303
return eventResponse;
304304
} else {
305305
return parsedJson;

0 commit comments

Comments
 (0)