Skip to content

Commit a7b8344

Browse files
UT's
1 parent e7b80ac commit a7b8344

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

sdm/src/test/java/unit/com/sap/cds/sdm/handler/applicationservice/SDMCreateAttachmentsHandlerTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,7 @@ public void testUpdateNameWithEmptyFilename() throws IOException {
555555
.when(() -> SDMUtils.hasRestrictedCharactersInName("fileNameInRequest"))
556556
.thenReturn(false);
557557

558-
when(dbQuery.getAttachmentForID(
559-
attachmentDraftEntity, persistenceService, "test-id", attachmentDraftEntity))
558+
when(dbQuery.getAttachmentForID(attachmentDraftEntity, persistenceService, "test-id"))
560559
.thenReturn(null);
561560

562561
// When getPropertiesForID is called
@@ -784,5 +783,4 @@ public void testUpdateNameWithRestrictedCharacters() throws IOException {
784783
// verify(attachment2).replace("fileName", "file2_sdm.txt"); // This one has restricted chars
785784
// verify(attachment3).replace("fileName", "file3_sdm.txt"); // This one had a conflict
786785
// }
787-
788786
}

sdm/src/test/java/unit/com/sap/cds/sdm/handler/applicationservice/SDMUpdateAttachmentsHandlerTest.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,18 +334,13 @@ public void testRenameWithNoSDMRoles() throws IOException {
334334
when(attachmentDraftEntity.getQualifiedName()).thenReturn("some.qualified.Name");
335335
when(model.findEntity("compositionDefinition"))
336336
.thenReturn(Optional.of(attachmentDraftEntity));
337-
when(model.findEntity("some.qualified.Name_drafts"))
338-
.thenReturn(Optional.of(mock(CdsEntity.class)));
339337
when(context.getMessages()).thenReturn(messages);
340338
UserInfo userInfo = Mockito.mock(UserInfo.class);
341339
when(context.getUserInfo()).thenReturn(userInfo);
342340
when(userInfo.isSystemUser()).thenReturn(false);
343341
when(tokenHandler.getSDMCredentials()).thenReturn(mockCredentials);
344342
when(dbQuery.getAttachmentForID(
345-
any(CdsEntity.class),
346-
any(PersistenceService.class),
347-
anyString(),
348-
any(CdsEntity.class)))
343+
any(CdsEntity.class), any(PersistenceService.class), anyString()))
349344
.thenReturn(mock(CmisDocument.class));
350345

351346
when(dbQuery.getPropertiesForID(

0 commit comments

Comments
 (0)