Skip to content

Commit 00d3b33

Browse files
fixing its
1 parent a0f6b71 commit 00d3b33

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

sdm/src/main/java/com/sap/cds/sdm/service/handler/SDMServiceGenericHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ private void editLink(EventContext context) throws IOException {
467467
logger.info("Successfully edited link");
468468
} else {
469469
if (status.equals("unauthorized")) {
470-
throw new ServiceException(SDMUtils.getErrorMessage("SDM_MISSING_ROLES_EXCEPTION_MSG"));
470+
throw new ServiceException(SDMUtils.getErrorMessage("SDM_MISSING_ROLES_EXCEPTION"));
471471
} else {
472472
throw new ServiceException(SDMUtils.getErrorMessage("FAILED_TO_EDIT_LINK"));
473473
}

sdm/src/test/java/integration/com/sap/cds/sdm/IntegrationTest_MultipleFacet.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ void testNAttachments_NewEntity() throws IOException {
21962196
response = api.saveEntityDraft(appUrl, entityName, srvpath, entityID4);
21972197
if (response.equals("Saved")) {
21982198
String expectedJson =
2199-
"{\"error\":{\"code\":\"500\",\"message\":\"Maximum number of attachments reached in English\"}}";
2199+
"{\"error\":{\"code\":\"500\",\"message\":\"Cannot upload more than 4 attachments.\"}}";
22002200
ObjectMapper objectMapper = new ObjectMapper();
22012201
JsonNode actualJsonNode = objectMapper.readTree(check);
22022202
JsonNode expectedJsonNode = objectMapper.readTree(expectedJson);
@@ -2244,7 +2244,7 @@ void testUploadNAttachments() throws IOException {
22442244
System.out.println("Result message for attachment " + i + ": " + resultMessage);
22452245

22462246
String expectedResponse =
2247-
"{\"error\":{\"code\":\"500\",\"message\":\"Maximum number of attachments reached in English\"}}";
2247+
"{\"error\":{\"code\":\"500\",\"message\":\"Cannot upload more than 4 attachments.\"}}";
22482248
if (resultMessage.equals(expectedResponse)) {
22492249
ObjectMapper objectMapper = new ObjectMapper();
22502250
JsonNode actualJsonNode = objectMapper.readTree(resultMessage);
@@ -3644,9 +3644,9 @@ void testCreateLinkFailure() throws IOException {
36443644
String errorMessage = json.getJSONObject("error").getString("message");
36453645
assertEquals("500", errorCode);
36463646
if (facetName.equals("references")) {
3647-
assertEquals("Maximum number of attachments reached in English", errorMessage);
3647+
assertEquals("Cannot upload more than 4 attachments.", errorMessage);
36483648
} else if (facetName.equals("attachments")) {
3649-
assertEquals("Maximum number of attachments reached in English", errorMessage);
3649+
assertEquals("Cannot upload more than 4 attachments.", errorMessage);
36503650
}
36513651
}
36523652
}

sdm/src/test/java/integration/com/sap/cds/sdm/IntegrationTest_SingleFacet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,7 +2157,7 @@ void testNAttachments_NewEntity() throws IOException {
21572157
response = api.saveEntityDraft(appUrl, entityName, srvpath, entityID4);
21582158
if (response.equals("Saved")) {
21592159
String expectedJson =
2160-
"{\"error\":{\"code\":\"500\",\"message\":\"Maximum number of attachments reached in English\"}}";
2160+
"{\"error\":{\"code\":\"500\",\"message\":\"Cannot upload more than 4 attachments.\"}}";
21612161
ObjectMapper objectMapper = new ObjectMapper();
21622162
JsonNode actualJsonNode = objectMapper.readTree(check);
21632163
JsonNode expectedJsonNode = objectMapper.readTree(expectedJson);
@@ -2205,7 +2205,7 @@ void testUploadNAttachments() throws IOException {
22052205
System.out.println("Result message for attachment " + i + ": " + resultMessage);
22062206

22072207
String expectedResponse =
2208-
"{\"error\":{\"code\":\"500\",\"message\":\"Maximum number of attachments reached in English\"}}";
2208+
"{\"error\":{\"code\":\"500\",\"message\":\"Cannot upload more than 4 attachments.\"}}";
22092209
if (resultMessage.equals(expectedResponse)) {
22102210
ObjectMapper objectMapper = new ObjectMapper();
22112211
JsonNode actualJsonNode = objectMapper.readTree(resultMessage);
@@ -3292,7 +3292,7 @@ void testCreateLinkFailure() throws IOException {
32923292
String errorCode = json.getJSONObject("error").getString("code");
32933293
String errorMessage = json.getJSONObject("error").getString("message");
32943294
assertEquals("500", errorCode);
3295-
assertEquals("Maximum number of attachments reached in English", errorMessage);
3295+
assertEquals("Cannot upload more than 4 attachments.", errorMessage);
32963296
}
32973297
String response = api.saveEntityDraft(appUrl, entityName, srvpath, createLinkEntity);
32983298
if (!response.equals("Saved")) {

0 commit comments

Comments
 (0)