Skip to content

Commit eb0d2ea

Browse files
fixing ITs
1 parent ba9a2b9 commit eb0d2ea

2 files changed

Lines changed: 39 additions & 61 deletions

File tree

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

Lines changed: 20 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ void testCreateEntitiesWithUnsupportedCharacter() throws IOException {
572572
response = api.saveEntityDraft(appUrl, entityName, srvpath, entityID);
573573

574574
String expected =
575-
"{\"error\":{\"code\":\"400\",\"message\":\"\\\"a/\\bc.pdf\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\",\"details\":[{\"code\":\"<none>\",\"message\":\"\\\"a/\\bc.pdf\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"\\\"a/\\bc.pdf\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\",\"@Common.numericSeverity\":4}]}}";
575+
"{\"error\":{\"code\":\"400\",\"message\":\"\\\"a/\\bc.pdf\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"details\":[{\"code\":\"<none>\",\"message\":\"\\\"a/\\bc.pdf\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"\\\"a/\\bc.pdf\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4}]}}";
576576
if (response.equals(expected)) {
577577
for (int i = 0; i < facet.length; i++) {
578578
response =
@@ -604,7 +604,7 @@ void testRenameEntitiesWithUnsupportedCharacter() {
604604
counter = -1; // Reset counter for the next check
605605
response = api.saveEntityDraft(appUrl, entityName, srvpath, entityID);
606606
String expected =
607-
"{\"error\":{\"code\":\"400\",\"message\":\"\\\"reference1/234\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\",\"details\":[{\"code\":\"<none>\",\"message\":\"\\\"sample/1234\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"\\\"footnote1/234\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\",\"@Common.numericSeverity\":4}]}}";
607+
"{\"error\":{\"code\":\"400\",\"message\":\"\\\"reference1/234\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"details\":[{\"code\":\"<none>\",\"message\":\"\\\"sample/1234\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"\\\"footnote1/234\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4}]}}";
608608
if (response.equals(expected)) {
609609
for (int i = 0; i < facet.length; i++) {
610610
response =
@@ -671,7 +671,7 @@ void testRenameSingleDuplicate() {
671671
response = api.saveEntityDraft(appUrl, entityName, srvpath, entityID);
672672
String expected =
673673
String.format(
674-
"{\"error\":{\"code\":\"400\",\"message\":\"An object named \\\"%s\\\" already exists. Rename the object and try again.\",\"details\":[{\"code\":\"<none>\",\"message\":\"An object named \\\"%s\\\" already exists. Rename the object and try again.\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"An object named \\\"%s\\\" already exists. Rename the object and try again.\",\"@Common.numericSeverity\":4}]}}",
674+
"{\"error\":{\"code\":\"400\",\"message\":\"An object named \\\"%s\\\" already exists. Rename the object and try again.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"details\":[{\"code\":\"<none>\",\"message\":\"An object named \\\"%s\\\" already exists. Rename the object and try again.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"An object named \\\"%s\\\" already exists. Rename the object and try again.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4}]}}",
675675
name[1], name[0], name[2]);
676676
if (response.equals(expected)) {
677677
for (int i = 0; i < facet.length; i++) {
@@ -718,7 +718,7 @@ void testRenameMultipleEntitiesWithOneUnsupportedCharacter() {
718718
if (successCount >= 2) {
719719
response = api.saveEntityDraft(appUrl, entityName, srvpath, entityID);
720720
String expected =
721-
"{\"error\":{\"code\":\"400\",\"message\":\"\\\"note/invalid\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\"}}";
721+
"{\"error\":{\"code\":\"400\",\"message\":\"\\\"note/invalid\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\"}}";
722722
if (response.equals(expected)) {
723723
response =
724724
api.renameAttachment(appUrl, entityName, facet[2], entityID, ID3[2], "note_valid");
@@ -782,7 +782,7 @@ void testRenameToValidateNames() throws IOException {
782782
if (allRenamedSuccessfully && "Renamed".equals(response2)) {
783783
response = api.saveEntityDraft(appUrl, entityName, srvpath, entityID3);
784784
String expected =
785-
"{\"error\":{\"code\":\"400\",\"message\":\"The object name cannot be empty or consist entirely of space characters. Enter a value.\",\"details\":[{\"code\":\"<none>\",\"message\":\"\\\"Restricted/Character\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"An object named \\\"duplicateName.pdf\\\" already exists. Rename the object and try again.\",\"@Common.numericSeverity\":4}]}}";
785+
"{\"error\":{\"code\":\"400\",\"message\":\"The object name cannot be empty or consist entirely of space characters. Enter a value.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"details\":[{\"code\":\"<none>\",\"message\":\"\\\"Restricted/Character\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"An object named \\\"duplicateName.pdf\\\" already exists. Rename the object and try again.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4}]}}";
786786
if (response.equals(expected)) {
787787
response = api.deleteEntityDraft(appUrl, entityName, entityID3);
788788
if (response.equals("Entity Draft Deleted")) testStatus = true;
@@ -814,31 +814,7 @@ void testRenameEntitiesWithoutSDMRole() throws IOException {
814814
if (testStatus) {
815815
apiResponse = apiNoRoles.saveEntityDraft(appUrl, entityName, srvpath, entityID);
816816
String expected =
817-
"[{\"code\":\"<none>\",\"message\":\"Could not update the following files. \\n"
818-
+ //
819-
"\\n"
820-
+ //
821-
"\\t\\u2022 reference123\\n"
822-
+ //
823-
"\\n"
824-
+ //
825-
"You do not have the required permissions to update attachments. Kindly contact the admin\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"Could not update the following files. \\n"
826-
+ //
827-
"\\n"
828-
+ //
829-
"\\t\\u2022 sample123\\n"
830-
+ //
831-
"\\n"
832-
+ //
833-
"You do not have the required permissions to update attachments. Kindly contact the admin\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"Could not update the following files. \\n"
834-
+ //
835-
"\\n"
836-
+ //
837-
"\\t\\u2022 footnote123\\n"
838-
+ //
839-
"\\n"
840-
+ //
841-
"You do not have the required permissions to update attachments. Kindly contact the admin\",\"numericSeverity\":3}]";
817+
"[{\"code\":\"<none>\",\"message\":\"Could not update the following files. \\n\\n\\t\\u2022 reference123\\n\\nYou do not have the required permissions to update attachments. Kindly contact the admin\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"Could not update the following files. \\n\\n\\t\\u2022 sample123\\n\\nYou do not have the required permissions to update attachments. Kindly contact the admin\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"Could not update the following files. \\n\\n\\t\\u2022 footnote123\\n\\nYou do not have the required permissions to update attachments. Kindly contact the admin\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"numericSeverity\":3}]";
842818
if (!apiResponse.equals(expected)) {
843819
testStatus = false;
844820
}
@@ -1226,23 +1202,23 @@ void testUpdateInvalidSecondaryProperty_beforeEntityIsSaved_single() throws IOEx
12261202
+ //
12271203
"\\n"
12281204
+ //
1229-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
1205+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
12301206
+ //
12311207
"\\n"
12321208
+ //
12331209
"\\t\\u2022 id1\\n"
12341210
+ //
12351211
"\\n"
12361212
+ //
1237-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
1213+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
12381214
+ //
12391215
"\\n"
12401216
+ //
12411217
"\\t\\u2022 id1\\n"
12421218
+ //
12431219
"\\n"
12441220
+ //
1245-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3}]";
1221+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"numericSeverity\":3}]";
12461222
if (response.equals(expectedResponse)) {
12471223
System.out.println("Entity saved");
12481224
testStatus = true;
@@ -1329,23 +1305,23 @@ void testUpdateInvalidSecondaryProperty_afterEntityIsSaved_single() throws IOExc
13291305
+ //
13301306
"\\n"
13311307
+ //
1332-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
1308+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
13331309
+ //
13341310
"\\n"
13351311
+ //
13361312
"\\t\\u2022 id1\\n"
13371313
+ //
13381314
"\\n"
13391315
+ //
1340-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
1316+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
13411317
+ //
13421318
"\\n"
13431319
+ //
13441320
"\\t\\u2022 id1\\n"
13451321
+ //
13461322
"\\n"
13471323
+ //
1348-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3}]";
1324+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"numericSeverity\":3}]";
13491325
if (response.equals(expectedResponse)) {
13501326
System.out.println("Entity saved");
13511327
testStatus = true;
@@ -1874,23 +1850,23 @@ void testUpdateInvalidSecondaryProperty_beforeEntityIsSaved_multipleAttachments(
18741850
+ //
18751851
"\\n"
18761852
+ //
1877-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
1853+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
18781854
+ //
18791855
"\\n"
18801856
+ //
18811857
"\\t\\u2022 id1\\n"
18821858
+ //
18831859
"\\n"
18841860
+ //
1885-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
1861+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
18861862
+ //
18871863
"\\n"
18881864
+ //
18891865
"\\t\\u2022 id1\\n"
18901866
+ //
18911867
"\\n"
18921868
+ //
1893-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3}]";
1869+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"numericSeverity\":3}]";
18941870
if (response.equals(expectedResponse)) {
18951871
System.out.println("Entity saved");
18961872
testStatus = true;
@@ -2075,23 +2051,23 @@ void testUpdateInvalidSecondaryProperty_afterEntityIsSaved_multipleAttachments()
20752051
+ //
20762052
"\\n"
20772053
+ //
2078-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
2054+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
20792055
+ //
20802056
"\\n"
20812057
+ //
20822058
"\\t\\u2022 id1\\n"
20832059
+ //
20842060
"\\n"
20852061
+ //
2086-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
2062+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"numericSeverity\":3},{\"code\":\"<none>\",\"message\":\"The following secondary properties are not supported.\\n"
20872063
+ //
20882064
"\\n"
20892065
+ //
20902066
"\\t\\u2022 id1\\n"
20912067
+ //
20922068
"\\n"
20932069
+ //
2094-
"Please contact your administrator for assistance with any necessary adjustments.\",\"numericSeverity\":3}]";
2070+
"Please contact your administrator for assistance with any necessary adjustments.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"numericSeverity\":3}]";
20952071
if (response.equals(expectedResponse)) {
20962072
System.out.println("Entity saved");
20972073
testStatus = true;
@@ -3276,7 +3252,7 @@ void testRenameLinkDuplicate() throws IOException {
32763252

32773253
String saveError = api.saveEntityDraft(appUrl, entityName, srvpath, createLinkEntity);
32783254
String expectedWarning =
3279-
"{\"error\":{\"code\":\"400\",\"message\":\"An object named \\\"sampleRenamed\\\" already exists. Rename the object and try again.\",\"details\":[{\"code\":\"<none>\",\"message\":\"An object named \\\"sampleRenamed\\\" already exists. Rename the object and try again.\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"An object named \\\"sampleRenamed\\\" already exists. Rename the object and try again.\",\"@Common.numericSeverity\":4}]}}";
3255+
"{\"error\":{\"code\":\"400\",\"message\":\"An object named \\\"sampleRenamed\\\" already exists. Rename the object and try again.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"details\":[{\"code\":\"<none>\",\"message\":\"An object named \\\"sampleRenamed\\\" already exists. Rename the object and try again.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"An object named \\\"sampleRenamed\\\" already exists. Rename the object and try again.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4}]}}";
32803256
ObjectMapper mapper = new ObjectMapper();
32813257
assertEquals(mapper.readTree(expectedWarning), mapper.readTree(saveError));
32823258

@@ -3342,11 +3318,7 @@ void testRenameLinkUnsupportedCharacters() throws IOException {
33423318
String error =
33433319
saveEntityResponse = api.saveEntityDraft(appUrl, entityName, srvpath, createLinkEntity);
33443320
String expectedError =
3345-
"{\"error\":{\"code\":\"400\",\"message\":\"\\\"sampleRenamed//\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\","
3346-
+ "\"details\":["
3347-
+ "{\"code\":\"<none>\",\"message\":\"\\\"sampleRenamed//\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\",\"@Common.numericSeverity\":4},"
3348-
+ "{\"code\":\"<none>\",\"message\":\"\\\"sampleRenamed//\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\",\"@Common.numericSeverity\":4}"
3349-
+ "]}}";
3321+
"{\"error\":{\"code\":\"400\",\"message\":\"\\\"sampleRenamed//\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: references\\nPage: IntegrationTestEntity\",\"details\":[{\"code\":\"<none>\",\"message\":\"\\\"sampleRenamed//\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: attachments\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4},{\"code\":\"<none>\",\"message\":\"\\\"sampleRenamed//\\\" contains unsupported characters (‘/’ or ‘\\\\’). Rename and try again.\\n\\nTable: footnotes\\nPage: IntegrationTestEntity\",\"@Common.numericSeverity\":4}]}}";
33503322
ObjectMapper mapper = new ObjectMapper();
33513323
assertEquals(mapper.readTree(expectedError), mapper.readTree(error));
33523324

0 commit comments

Comments
 (0)