Skip to content
Snippets Groups Projects
Commit 24cebec4 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6510 implement comments from code review

parent 396b86ec
Branches
Tags
No related merge requests found
...@@ -129,7 +129,7 @@ class EingangFilesRepositoryITCase { ...@@ -129,7 +129,7 @@ class EingangFilesRepositoryITCase {
.build()) .build())
.build()); .build());
var result = repository.findAttachments(vorgang.getId(), Optional.ofNullable(eingangId)); var result = repository.findAttachments(vorgang.getId(), Optional.of(eingangId));
assertThat(result).hasSize(3); assertThat(result).hasSize(3);
} }
...@@ -210,7 +210,7 @@ class EingangFilesRepositoryITCase { ...@@ -210,7 +210,7 @@ class EingangFilesRepositoryITCase {
var vorgang = mongoOperations.save(VorgangTestFactory.createBuilder().id(null).version(0L).clearEingangs() var vorgang = mongoOperations.save(VorgangTestFactory.createBuilder().id(null).version(0L).clearEingangs()
.eingang(EingangTestFactory.createBuilder().id(eingangId).representation(IncomingFileTestFactory.create()).build()).build()); .eingang(EingangTestFactory.createBuilder().id(eingangId).representation(IncomingFileTestFactory.create()).build()).build());
var result = repository.findRepresentations(vorgang.getId(), Optional.ofNullable(eingangId)); var result = repository.findRepresentations(vorgang.getId(), Optional.of(eingangId));
assertThat(result).hasSize(2); assertThat(result).hasSize(2);
} }
......
...@@ -172,7 +172,7 @@ class FileServiceTest { ...@@ -172,7 +172,7 @@ class FileServiceTest {
class TestGetAttachments { class TestGetAttachments {
@Test @Test
void shouldCallCheckPermissions() { void shouldCallCheckPermission() {
getAttachments(); getAttachments();
verify(policyService).checkPermission(VorgangTestFactory.ID); verify(policyService).checkPermission(VorgangTestFactory.ID);
...@@ -182,7 +182,7 @@ class FileServiceTest { ...@@ -182,7 +182,7 @@ class FileServiceTest {
void shouldCallFindAttachments() { void shouldCallFindAttachments() {
getAttachments(); getAttachments();
verify(repository).findAttachments(VorgangTestFactory.ID, Optional.ofNullable(EingangTestFactory.ID)); verify(repository).findAttachments(VorgangTestFactory.ID, Optional.of(EingangTestFactory.ID));
} }
@Test @Test
...@@ -196,7 +196,7 @@ class FileServiceTest { ...@@ -196,7 +196,7 @@ class FileServiceTest {
} }
private List<OzgFile> getAttachments() { private List<OzgFile> getAttachments() {
return service.getAttachments(VorgangTestFactory.ID, Optional.ofNullable(EingangTestFactory.ID)); return service.getAttachments(VorgangTestFactory.ID, Optional.of(EingangTestFactory.ID));
} }
} }
...@@ -204,7 +204,7 @@ class FileServiceTest { ...@@ -204,7 +204,7 @@ class FileServiceTest {
class TestGetRepresentations { class TestGetRepresentations {
@Test @Test
void shouldCallCheckPermissions() { void shouldCallCheckPermission() {
getRepresentations(); getRepresentations();
verify(policyService).checkPermission(VorgangTestFactory.ID); verify(policyService).checkPermission(VorgangTestFactory.ID);
...@@ -214,7 +214,7 @@ class FileServiceTest { ...@@ -214,7 +214,7 @@ class FileServiceTest {
void shouldCallFindRepresentations() { void shouldCallFindRepresentations() {
getRepresentations(); getRepresentations();
verify(repository).findRepresentations(VorgangTestFactory.ID, Optional.ofNullable(EingangTestFactory.ID)); verify(repository).findRepresentations(VorgangTestFactory.ID, Optional.of(EingangTestFactory.ID));
} }
@Test @Test
...@@ -228,7 +228,7 @@ class FileServiceTest { ...@@ -228,7 +228,7 @@ class FileServiceTest {
} }
private List<OzgFile> getRepresentations() { private List<OzgFile> getRepresentations() {
return service.getRepresentations(VorgangTestFactory.ID, Optional.ofNullable(EingangTestFactory.ID)); return service.getRepresentations(VorgangTestFactory.ID, Optional.of(EingangTestFactory.ID));
} }
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment