Skip to content

Commit f920d7d

Browse files
committed
Integration Test for Restricated characters with suggested changes
1 parent 4c8211b commit f920d7d

2 files changed

Lines changed: 0 additions & 101 deletions

File tree

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

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -599,58 +599,6 @@ void testDeleteMultipleAttachmentsReferencesFootnotes() throws IOException {
599599
} else fail("Could not save entity after deletion");
600600
}
601601

602-
// @Test
603-
// @Order(13)
604-
// void testUploadMultipleAttachment_RestrictedCharacters() throws IOException {
605-
// System.out.println("Test (13) : Restricted characters");
606-
// ClassLoader classLoader = getClass().getClassLoader();
607-
// File file = new File(classLoader.getResource("abc.pdf").getFile());
608-
// Boolean testStatus = false;
609-
610-
// Map<String, Object> postData = new HashMap<>();
611-
// postData.put("up__ID", entityID2);
612-
// postData.put("mimeType", "application/pdf");
613-
// postData.put("createdAt", new Date().toString());
614-
// postData.put("createdBy", "test@test.com");
615-
// postData.put("modifiedBy", "test@test.com");
616-
617-
// String response = api.editEntityDraft(appUrl, serviceName, entityName, srvpath, entityID2);
618-
// if (response == "Entity in draft mode") {
619-
// for (int i = 0; i < facet.length; i++) {
620-
// List<String> createResponse =
621-
// api.createAttachment_RestrictedCharacter(
622-
// appUrl, serviceName, entityName, facet[0], entityID2, srvpath, postData, file);
623-
624-
// if (createResponse.get(0).equals("Attachment created")) {
625-
// ID[0] = createResponse.get(1);
626-
// System.out.println("Attachment created");
627-
// testStatus = true;
628-
// if (response.equals("Renamed")) counter++;
629-
// }
630-
// if (counter >= 2) {
631-
// counter = -1;
632-
// response = api.saveEntityDraft(appUrl, serviceName, entityName, srvpath, entityID);
633-
// System.out.println(response);
634-
// if (response.contains("Rename unsuccessful")
635-
// && response.contains("unsupported characters")) {
636-
// testStatus = true;
637-
// }
638-
// } else {
639-
// api.saveEntityDraft(appUrl, serviceName, entityName, srvpath, entityID);
640-
// }
641-
// }
642-
// }
643-
// if (!testStatus) {
644-
// fail("Attachment was renamed with restricted characters");
645-
// }
646-
// // String deleteEntityResponse = api.deleteEntity(appUrl, serviceName, entityName,entityID2);
647-
// // if (deleteEntityResponse.equals("Entity Deleted")) {
648-
// // System.out.println("Entity deleted successfully");
649-
// // } else {
650-
// // System.out.println("Failed to delete entity: " + deleteEntityResponse);
651-
// // }
652-
// }
653-
654602
@Test
655603
@Order(13)
656604
void testUploadMultipleAttachment_RestrictedCharacters() throws IOException {

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

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -526,55 +526,6 @@ void testDeleteMultipleAttachments() throws IOException {
526526
}
527527
}
528528

529-
// @Test
530-
// @Order(13)
531-
// void testUploadSingleAttachment_RestrictedCharacters() throws IOException {
532-
// System.out.println("Test (13) : Restricted characters");
533-
// ClassLoader classLoader = getClass().getClassLoader();
534-
// File file = new File(classLoader.getResource("sample.pdf").getFile());
535-
// Boolean testStatus = false;
536-
537-
// Map<String, Object> postData = new HashMap<>();
538-
// postData.put("up__ID", entityID3);
539-
// postData.put("mimeType", "application/pdf");
540-
// postData.put("createdAt", new Date().toString());
541-
// postData.put("createdBy", "test@test.com");
542-
// postData.put("modifiedBy", "test@test.com");
543-
544-
// String response = api.editEntityDraft(appUrl, serviceName, entityName, srvpath, entityID4);
545-
// if (response == "Entity in draft mode") {
546-
// List<String> createResponse =
547-
// api.createAttachment_RestrictedCharacter(
548-
// appUrl, serviceName, entityName, facetName, entityID4, srvpath, postData, file);
549-
// if (createResponse.get(0).equals("Attachment created")) {
550-
// entityID4 = createResponse.get(1);
551-
// System.out.println("Attachment created");
552-
// testStatus = true;
553-
554-
// if (response.equals("Renamed")) {
555-
// response = api.saveEntityDraft(appUrl, serviceName, entityName, srvpath, entityID4);
556-
// System.out.println("Shubham response" + response);
557-
// if (response.contains("Rename unsuccessful")
558-
// && response.contains("restricted characters")
559-
// && response.contains("invalid/name")) {
560-
// testStatus = true;
561-
// } else {
562-
// api.saveEntityDraft(appUrl, serviceName, entityName, srvpath, entityID3);
563-
// }
564-
// }
565-
// }
566-
// }
567-
// if (!testStatus) {
568-
// fail("Attachment was renamed with restricted characters");
569-
// }
570-
// String deleteEntityResponse = api.deleteEntity(appUrl, serviceName, entityName, entityID4);
571-
// if (deleteEntityResponse.equals("Entity Deleted")) {
572-
// System.out.println("Entity deleted successfully");
573-
// } else {
574-
// System.out.println("Failed to delete entity: " + deleteEntityResponse);
575-
// }
576-
// }
577-
578529
@Test
579530
@Order(13)
580531
void testUploadSingleAttachment_RestrictedCharacters() throws IOException {

0 commit comments

Comments
 (0)