Skip to content

Commit 1316f79

Browse files
committed
fix issues
1 parent 0fa8cf2 commit 1316f79

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6610,7 +6610,13 @@ void testReadCmisMetadataCreatedBy() {
66106610
String createdBy =
66116611
CmisDocumentHelper.getCmisProperty(chapterID, "sample.pdf", "cmis:createdBy");
66126612
System.out.println("cmis:createdBy value: " + createdBy);
6613-
assertEquals(username, createdBy, "cmis:createdBy should match username from credentials");
6613+
String tokenFlowFlag = System.getProperty("tokenFlow");
6614+
if ("namedUser".equals(tokenFlowFlag)) {
6615+
assertEquals(username, createdBy, "cmis:createdBy should match username from credentials");
6616+
} else {
6617+
assertNotNull(createdBy, "cmis:createdBy should not be null for technical user");
6618+
assertFalse(createdBy.isEmpty(), "cmis:createdBy should not be empty for technical user");
6619+
}
66146620
}
66156621

66166622
@Test

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7069,7 +7069,13 @@ void testReadCmisMetadataCreatedBy() {
70697069
System.out.println("Test (76) : Read CMIS metadata and verify createdBy field");
70707070
String createdBy = CmisDocumentHelper.getCmisProperty(entityID, "sample.pdf", "cmis:createdBy");
70717071
System.out.println("cmis:createdBy value: " + createdBy);
7072-
assertEquals(username, createdBy, "cmis:createdBy should match username from credentials");
7072+
String tokenFlowFlag = System.getProperty("tokenFlow");
7073+
if ("namedUser".equals(tokenFlowFlag)) {
7074+
assertEquals(username, createdBy, "cmis:createdBy should match username from credentials");
7075+
} else {
7076+
assertNotNull(createdBy, "cmis:createdBy should not be null for technical user");
7077+
assertFalse(createdBy.isEmpty(), "cmis:createdBy should not be empty for technical user");
7078+
}
70737079
}
70747080

70757081
@Test

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6526,7 +6526,13 @@ void testReadCmisMetadataCreatedBy() {
65266526
System.out.println("Test (76) : Read CMIS metadata and verify createdBy field");
65276527
String createdBy = CmisDocumentHelper.getCmisProperty(entityID, "sample.pdf", "cmis:createdBy");
65286528
System.out.println("cmis:createdBy value: " + createdBy);
6529-
assertEquals(username, createdBy, "cmis:createdBy should match username from credentials");
6529+
String tokenFlowFlag = System.getProperty("tokenFlow");
6530+
if ("namedUser".equals(tokenFlowFlag)) {
6531+
assertEquals(username, createdBy, "cmis:createdBy should match username from credentials");
6532+
} else {
6533+
assertNotNull(createdBy, "cmis:createdBy should not be null for technical user");
6534+
assertFalse(createdBy.isEmpty(), "cmis:createdBy should not be empty for technical user");
6535+
}
65306536
}
65316537

65326538
private boolean waitForUploadCompletion(
@@ -6535,7 +6541,7 @@ private boolean waitForUploadCompletion(
65356541
for (int i = 0; i < maxIterations; i++) {
65366542
try {
65376543
Map<String, Object> metadata =
6538-
api.fetchMetadataDraft(appUrl, entityName, facetName, entityId, attachmentId);
6544+
api.fetchMetadata(appUrl, entityName, facetName, entityId, attachmentId);
65396545
String uploadStatus = (String) metadata.get("uploadStatus");
65406546

65416547
if ("Success".equals(uploadStatus)) {

0 commit comments

Comments
 (0)