Skip to content
Snippets Groups Projects
Commit 9e1d2aae authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6720 OZG-7051 fix signatur patching

parent 2d0a353e
Branches
Tags
No related merge requests found
......@@ -50,10 +50,11 @@ class OrganisationsEinheitService {
}
OrganisationsEinheit patchOrganisationsEinheit(OrganisationsEinheit organisationsEinheit, OrganisationsEinheitPatch patch) {
var organisationsEinheitBuilder = organisationsEinheit.toBuilder();
if (Objects.nonNull(patch.getSignatur())) {
organisationsEinheitBuilder.settings(organisationsEinheit.getSettings().toBuilder().signatur(patch.getSignatur()).build());
}
return organisationsEinheitBuilder.build();
return organisationsEinheit.toBuilder()
.settings(
organisationsEinheit.getSettings().toBuilder()
.signatur(patch.getSignatur())
.build())
.build();
}
}
......@@ -252,15 +252,5 @@ class OrganisationsEinheitServiceTest {
.ignoringFields(OrganisationsEinheit.FIELD_SETTINGS)
.isEqualTo(organisationsEinheit);
}
@Test
void shouldNotPatchSignaturIfNull() {
var organisationsEinheit = OrganisationsEinheitTestFactory.create();
var organisationsEinheitPatch = OrganisationsEinheitPatchTestFactory.createBuilder().signatur(null).build();
var patched = service.patchOrganisationsEinheit(organisationsEinheit, organisationsEinheitPatch);
assertThat(patched.getSettings().getSignatur()).isEqualTo(OrganisationsEinheitSettingsTestFactory.SIGNATUR);
}
}
}
\ 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