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

OZG-3539 OZG-6749 add new user settings

parent 741f1bde
Branches
Tags
No related merge requests found
...@@ -23,14 +23,12 @@ ...@@ -23,14 +23,12 @@
*/ */
package de.ozgcloud.user.settings; package de.ozgcloud.user.settings;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@Builder(toBuilder = true) @Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@Getter @Getter
@Setter @Setter
...@@ -39,4 +37,21 @@ public class UserSettings { ...@@ -39,4 +37,21 @@ public class UserSettings {
static final String NOTIFICATIONS_SEND_FOR_FIELD = "notificationsSendFor"; static final String NOTIFICATIONS_SEND_FOR_FIELD = "notificationsSendFor";
private NotificationsSendFor notificationsSendFor; private NotificationsSendFor notificationsSendFor;
private boolean vorgangCreated;
private boolean vorgangAssignedToUser;
private boolean postfachNachrichtFromAntragsteller;
private boolean wiedervorlageOverdue;
public UserSettings(final NotificationsSendFor notificationsSendFor, final boolean vorgangCreated, final boolean vorgangAssignedToUser,
final boolean postfachNachrichtFromAntragsteller, final boolean wiedervorlageOverdue) {
this.notificationsSendFor = notificationsSendFor;
this.vorgangCreated = vorgangCreated;
this.vorgangAssignedToUser = vorgangAssignedToUser;
this.postfachNachrichtFromAntragsteller = postfachNachrichtFromAntragsteller;
this.wiedervorlageOverdue = wiedervorlageOverdue;
}
public UserSettings(final NotificationsSendFor notificationsSendFor) {
this(notificationsSendFor, notificationsSendFor == NotificationsSendFor.ALL, true, true, true);
}
} }
package de.ozgcloud.user.settings;
import static org.assertj.core.api.Assertions.*;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
class UserSettingsTest {
@Nested
class TestConstructor {
@Test
void shouldCreateWithVorgangCreatedSet() {
var userSettings = new UserSettings(NotificationsSendFor.ALL);
assertThat(userSettings.isVorgangCreated()).isTrue();
}
@Test
void shouldCreateWithVorgangCreatedUnset() {
var userSettings = new UserSettings(NotificationsSendFor.NONE);
assertThat(userSettings.isVorgangCreated()).isFalse();
}
}
}
\ 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