Repository: urlaubsverwaltung/urlaubsverwaltung (java)

Issue:
Krankmeldung: Verlängerungen können invalide Krankmeldungen erzeugen
Durch das Beta-Feature "Benutzer können Krankmeldungen selbst eintragen" in den Einstellungen, siehe

![image](https://github.com/user-attachments/assets/4f99c07d-6296-4dc8-86a3-98bf6b5b2576)

kann es dazu führen, dass eine einzelne Krankmeldung zunächst mit einem halben Tag angelegt wird und man diesen dann um einen Tag verlängert, wird dieser fälschlicherweise um einen Tag erweitert und ist dann 1,5 Tage lang. Dies ist inkorrekt. In diesem Fall müssten zwei Krankmeldungen angelegt werden.


**Ein Symptom davon ist dann:**
Hat man eine Krankheit eingetragen, welche gegen die Validierung von Periode https://github.com/urlaubsverwaltung/urlaubsverwaltung/blob/main/src/main/java/org/synyx/urlaubsverwaltung/period/Period.java#L24 verstößt und diese im Ical Kalender enthalten ist, so ist es nicht mehr möglich den Ical Kalender abzurufen.

Im Hintergrund fliegt eine IllegalArgumentException, triggert den Error-Handler von Spring Boot und man wird zur Login-Seite geleitet.

Beispiel Sicknote aus der DB

| id | start_date  | end_date    | day_length |
|----|-------------|-------------|------------|
| 1  | 2024-12-02  | 2024-12-03  | NOON       |


Pull request description:
SickNote extend: do not redirect to extend if sicknote is not full day
closes #5022 

<!--

Thanks for contributing to the Urlaubsverwaltung.
Please review the following notes before submitting you pull request.

Please look for other issues or pull requests which already work on this topic. Is somebody already on it? Do you need to synchronize?

# Security Vulnerabilities

🛑 STOP! 🛑 If your contribution fixes a security vulnerability, please do not submit it.
Instead, please open a report of a security vulnerability via
[Report a security vulnerability](https://github.com/urlaubsverwaltung/urlaubsverwaltung/security/advisories/new)


# Describing Your Changes

If, having reviewed the notes above, you're ready to submit your pull request, please
provide a brief description of the proposed changes.

If they:
 🐞 fix a bug, please describe the broken behaviour and how the changes fix it.
    Please label with 'type: bug' and 'status: new'
    
 🎁 make an enhancement, please describe the new functionality and why you believe it's useful.
    Please label with 'type: enhancement' and 'status: new'
 
If your pull request relates to any existing issues,
please reference them by using the issue number prefixed with #.

-->


Patch:
diff --git a/src/main/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/SickNoteViewController.java b/src/main/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/SickNoteViewController.java
index 13efbcf29..c8da6e2f2 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/SickNoteViewController.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/SickNoteViewController.java
@@ -218,7 +218,8 @@ class SickNoteViewController implements HasLaunchpad {
 
         if (userIsAllowedToSubmitSickNotes) {
             final boolean noRedirect = noExtensionRedirect != null && (noExtensionRedirect.isEmpty() || "true".equalsIgnoreCase(noExtensionRedirect));
-            if (!noRedirect && sickNoteService.getSickNoteOfYesterdayOrLastWorkDay(sickNotePerson).isPresent()) {
+            final Optional<SickNote> sickNoteOfYesterdayOrLastWorkDay = sickNoteService.getSickNoteOfYesterdayOrLastWorkDay(sickNotePerson);
+            if (!noRedirect && (sickNoteOfYesterdayOrLastWorkDay.isPresent() && sickNoteOfYesterdayOrLastWorkDay.get().getDayLength().isFull())) {
                 LOG.info("sick note of last work day found");
                 return "redirect:/web/sicknote/extend";
             } else {
diff --git a/src/main/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/extend/SickNoteExtendViewController.java b/src/main/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/extend/SickNoteExtendViewController.java
index b0e1d6154..0a832af40 100644
--- a/src/main/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/extend/SickNoteExtendViewController.java
+++ b/src/main/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/extend/SickNoteExtendViewController.java
@@ -25,6 +25,7 @@ import org.synyx.urlaubsverwaltung.workingtime.WorkingTimeCalendarService;
 import java.math.BigDecimal;
 import java.time.Clock;
 import java.time.LocalDate;
+import java.time.format.FormatStyle;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
@@ -32,7 +33,6 @@ import java.util.UUID;
 
 import static java.time.DayOfWeek.MONDAY;
 import static java.time.DayOfWeek.SUNDAY;
-import static java.time.format.FormatStyle.FULL;
 import static java.time.temporal.TemporalAdjusters.next;
 import static java.time.temporal.TemporalAdjusters.nextOrSame;
 import static java.time.temporal.TemporalAdjusters.previousOrSame;
@@ -77,7 +77,7 @@ class SickNoteExtendViewController implements HasLaunchpad {
 
         final Person signedInUser = personService.getSignedInUser();
         final Optional<SickNote> maybeSickNote = getSickNoteOfYesterdayOrLastWorkDay(signedInUser);
-        if (maybeSickNote.isEmpty()) {
+        if (maybeSickNote.isEmpty() || maybeSickNote.get().getDayLength().isHalfDay()) {
             return "sicknote/sick_note_extended_not_found";
         }
 
@@ -108,8 +108,8 @@ class SickNoteExtendViewController implements HasLaunchpad {
 
         final Person signedInUser = personService.getSignedInUser();
         final Optional<SickNote> maybeSickNote = getSickNoteOfYesterdayOrLastWorkDay(signedInUser);
-        if (maybeSickNote.isEmpty()) {
-            return"sicknote/sick_note_extended_not_found";
+        if (maybeSickNote.isEmpty() || maybeSickNote.get().getDayLength().isHalfDay()) {
+            return "sicknote/sick_note_extended_not_found";
         }
 
         if (!hasUserSelectedCustomDate) {
@@ -228,10 +228,10 @@ class SickNoteExtendViewController implements HasLaunchpad {
         model.addAttribute("today", today);
         model.addAttribute("sickNoteTypeChild", sickNote.getSickNoteType().getCategory().equals(SICK_NOTE_CHILD));
         model.addAttribute("extendToDate", extendToDate == null ? today : extendToDate);
-        model.addAttribute("sickNoteEndDateWord", dateFormatAware.formatWord(sickNote.getEndDate(), FULL));
-        model.addAttribute("plusOneWorkdayWord", dateFormatAware.formatWord(plusOneWorkdayDate, FULL));
-        model.addAttribute("plusTwoWorkdaysWord", dateFormatAware.formatWord(plusTwoWorkdaysDate, FULL));
-        model.addAttribute("untilEndOfWeekWord", dateFormatAware.formatWord(endOfWeek(), FULL));
+        model.addAttribute("sickNoteEndDateWord", dateFormatAware.formatWord(sickNote.getEndDate(), FormatStyle.FULL));
+        model.addAttribute("plusOneWorkdayWord", dateFormatAware.formatWord(plusOneWorkdayDate, FormatStyle.FULL));
+        model.addAttribute("plusTwoWorkdaysWord", dateFormatAware.formatWord(plusTwoWorkdaysDate, FormatStyle.FULL));
+        model.addAttribute("untilEndOfWeekWord", dateFormatAware.formatWord(endOfWeek(), FormatStyle.FULL));
     }
 
     private void prepareSickNoteExtendPreview(Person signedInUser, SickNote sickNote, SickNoteExtendDto sickNoteExtendDto, String extend,


Test patch:
diff --git a/src/test/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/SickNoteViewControllerTest.java b/src/test/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/SickNoteViewControllerTest.java
index d9b01940b..26e2a52cc 100644
--- a/src/test/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/SickNoteViewControllerTest.java
+++ b/src/test/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/SickNoteViewControllerTest.java
@@ -21,6 +21,7 @@ import org.synyx.urlaubsverwaltung.application.vacationtype.VacationTypeService;
 import org.synyx.urlaubsverwaltung.application.vacationtype.VacationTypeViewModelService;
 import org.synyx.urlaubsverwaltung.department.Department;
 import org.synyx.urlaubsverwaltung.department.DepartmentService;
+import org.synyx.urlaubsverwaltung.period.DayLength;
 import org.synyx.urlaubsverwaltung.person.Person;
 import org.synyx.urlaubsverwaltung.person.PersonService;
 import org.synyx.urlaubsverwaltung.person.Role;
@@ -61,6 +62,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
 import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standaloneSetup;
 import static org.synyx.urlaubsverwaltung.application.vacationtype.VacationCategory.OVERTIME;
 import static org.synyx.urlaubsverwaltung.application.vacationtype.VacationTypeColor.ORANGE;
+import static org.synyx.urlaubsverwaltung.period.DayLength.FULL;
 import static org.synyx.urlaubsverwaltung.person.Role.BOSS;
 import static org.synyx.urlaubsverwaltung.person.Role.DEPARTMENT_HEAD;
 import static org.synyx.urlaubsverwaltung.person.Role.INACTIVE;
@@ -123,6 +125,24 @@ class SickNoteViewControllerTest {
             Clock.systemUTC());
     }
 
+    @ParameterizedTest
+    @EnumSource(value = DayLength.class, names = "FULL", mode = EnumSource.Mode.EXCLUDE)
+    void ensureGetNewSickNoteDoesNotRedirectToExtendIfSickNoteIsNotFull(final DayLength dayLength) throws Exception {
+
+        userIsAllowedToSubmitSickNotes(true);
+
+        final Person person = personWithRole(USER, SICK_NOTE_ADD);
+        person.setId(1L);
+
+        when(personService.getSignedInUser()).thenReturn(person);
+        when(personService.getPersonByID(1L)).thenReturn(Optional.of(person));
+        when(sickNoteService.getSickNoteOfYesterdayOrLastWorkDay(person)).thenReturn(Optional.of(SickNote.builder().id(1L).dayLength(dayLength).build()));
+
+        perform(get("/web/sicknote/new").param("person", "1"))
+            .andExpect(status().isOk())
+            .andExpect(view().name("sicknote/sick_note_form"));
+    }
+
     @Test
     void ensureGetNewSickNoteRedirectsWhenExtensionIsPossibleAndFeatureIsEnabled() throws Exception {
 
@@ -133,7 +153,7 @@ class SickNoteViewControllerTest {
 
         when(personService.getSignedInUser()).thenReturn(person);
         when(personService.getPersonByID(1L)).thenReturn(Optional.of(person));
-        when(sickNoteService.getSickNoteOfYesterdayOrLastWorkDay(person)).thenReturn(Optional.of(anySickNote()));
+        when(sickNoteService.getSickNoteOfYesterdayOrLastWorkDay(person)).thenReturn(Optional.of(SickNote.builder().id(1L).dayLength(FULL).build()));
 
         perform(get("/web/sicknote/new").param("person", "1"))
             .andExpect(status().is3xxRedirection())
@@ -200,8 +220,8 @@ class SickNoteViewControllerTest {
         )
             .andExpect(status().isOk())
             .andExpect(model().attribute("sickNote",
-                hasProperty("sickNoteType",
-                    hasProperty("category", equalTo(givenCategory)))
+                    hasProperty("sickNoteType",
+                        hasProperty("category", equalTo(givenCategory)))
                 )
             );
     }
@@ -248,13 +268,13 @@ class SickNoteViewControllerTest {
         when(sickNoteTypeService.getSickNoteTypes()).thenReturn(sickNoteTypes);
 
         perform(get("/web/sicknote/new").param("person", "1"))
-                .andExpect(status().isOk())
-                .andExpect(model().attribute("sickNote", instanceOf(SickNoteFormDto.class)))
-                .andExpect(model().attribute("persons", empty()))
-                .andExpect(model().attribute("person", personWithRole))
-                .andExpect(model().attribute("signedInUser", personWithRole))
-                .andExpect(model().attribute("sickNoteTypes", sickNoteTypes))
-                .andExpect(view().name("sicknote/sick_note_form"));
+            .andExpect(status().isOk())
+            .andExpect(model().attribute("sickNote", instanceOf(SickNoteFormDto.class)))
+            .andExpect(model().attribute("persons", empty()))
+            .andExpect(model().attribute("person", personWithRole))
+            .andExpect(model().attribute("signedInUser", personWithRole))
+            .andExpect(model().attribute("sickNoteTypes", sickNoteTypes))
+            .andExpect(view().name("sicknote/sick_note_form"));
     }
 
     @Test
@@ -267,7 +287,7 @@ class SickNoteViewControllerTest {
         userIsAllowedToSubmitSickNotes(false);
 
         assertThatThrownBy(() ->
-                perform(get("/web/sicknote/new").param("person", "1"))
+            perform(get("/web/sicknote/new").param("person", "1"))
         ).hasCauseInstanceOf(AccessDeniedException.class);
     }
 
@@ -541,15 +561,15 @@ class SickNoteViewControllerTest {
         when(personService.getSignedInUser()).thenReturn(signedInUser);
 
         final SickNote sickNote = SickNote.builder()
-                .person(signedInUser)
-                .status(SUBMITTED)
-                .build();
+            .person(signedInUser)
+            .status(SUBMITTED)
+            .build();
 
         when(sickNoteService.getById(SOME_SICK_NOTE_ID)).thenReturn(Optional.of(sickNote));
         when(departmentService.isDepartmentHeadAllowedToManagePerson(signedInUser, signedInUser)).thenReturn(false);
 
         perform(get("/web/sicknote/" + SOME_SICK_NOTE_ID + "/edit"))
-                .andExpect(status().isOk());
+            .andExpect(status().isOk());
     }
 
     @Test
@@ -602,15 +622,15 @@ class SickNoteViewControllerTest {
         when(personService.getSignedInUser()).thenReturn(signedInUser);
 
         final SickNote sickNote = SickNote.builder()
-                .person(signedInUser)
-                .status(ACTIVE)
-                .build();
+            .person(signedInUser)
+            .status(ACTIVE)
+            .build();
 
         when(sickNoteService.getById(SOME_SICK_NOTE_ID)).thenReturn(Optional.of(sickNote));
         when(departmentService.isDepartmentHeadAllowedToManagePerson(signedInUser, signedInUser)).thenReturn(false);
 
         assertThatThrownBy(() ->
-                perform(get("/web/sicknote/" + SOME_SICK_NOTE_ID + "/edit"))
+            perform(get("/web/sicknote/" + SOME_SICK_NOTE_ID + "/edit"))
         ).hasCauseInstanceOf(AccessDeniedException.class);
     }
 
@@ -1178,11 +1198,11 @@ class SickNoteViewControllerTest {
         when(personService.getSignedInUser()).thenReturn(signedInPerson);
 
         when(sickNoteInteractionService.submit(any(SickNote.class), eq(signedInPerson), eq(null)))
-                .thenReturn(SickNote.builder().id(42L).build());
+            .thenReturn(SickNote.builder().id(42L).build());
 
         perform(post("/web/sicknote").param("person.id", "1"))
-                .andExpect(status().is3xxRedirection())
-                .andExpect(redirectedUrl("/web/sicknote/42"));
+            .andExpect(status().is3xxRedirection())
+            .andExpect(redirectedUrl("/web/sicknote/42"));
     }
 
     @ParameterizedTest
@@ -1198,11 +1218,11 @@ class SickNoteViewControllerTest {
         when(personService.getSignedInUser()).thenReturn(signedInPerson);
 
         when(sickNoteInteractionService.create(any(SickNote.class), eq(signedInPerson), eq(null)))
-                .thenReturn(SickNote.builder().id(42L).build());
+            .thenReturn(SickNote.builder().id(42L).build());
 
         perform(post("/web/sicknote").param("person.id", "1"))
-                .andExpect(status().is3xxRedirection())
-                .andExpect(redirectedUrl("/web/sicknote/42"));
+            .andExpect(status().is3xxRedirection())
+            .andExpect(redirectedUrl("/web/sicknote/42"));
     }
 
     @Test
@@ -1229,7 +1249,7 @@ class SickNoteViewControllerTest {
         when(sickNoteService.getById(SOME_SICK_NOTE_ID)).thenReturn(Optional.empty());
 
         assertThatThrownBy(() ->
-                perform(post("/web/sicknote/" + SOME_SICK_NOTE_ID + "/accept"))
+            perform(post("/web/sicknote/" + SOME_SICK_NOTE_ID + "/accept"))
         ).hasCauseInstanceOf(UnknownSickNoteException.class);
     }
 
@@ -1253,7 +1273,7 @@ class SickNoteViewControllerTest {
                 .param("endDate", givenDate)
                 .param("aubStartDate", givenDate)
                 .param("aubEndDate", givenDate)
-                    .param("person.id", "2")
+                .param("person.id", "2")
         )
             .andExpect(status().is3xxRedirection())
             .andExpect(redirectedUrl("/web/sicknote/42"));
@@ -1294,7 +1314,7 @@ class SickNoteViewControllerTest {
         }).when(sickNoteValidator).validate(any(), any());
 
         perform(post("/web/sicknote/" + SOME_SICK_NOTE_ID + "/edit")
-                .param("person", "1"))
+            .param("person", "1"))
             .andExpect(model().attribute("vacationTypeColors", equalTo(List.of(new VacationTypeDto(1L, ORANGE)))))
             .andExpect(model().attribute("person", signedInPerson))
             .andExpect(view().name("sicknote/sick_note_form"));
@@ -1360,7 +1380,7 @@ class SickNoteViewControllerTest {
         when(sickNoteService.getById(SOME_SICK_NOTE_ID)).thenReturn(Optional.of(SickNote.builder().person(new Person()).status(status).build()));
 
         assertThatThrownBy(() ->
-                perform(post("/web/sicknote/" + SOME_SICK_NOTE_ID + "/edit"))
+            perform(post("/web/sicknote/" + SOME_SICK_NOTE_ID + "/edit"))
         ).hasCauseInstanceOf(AccessDeniedException.class);
     }
 
@@ -1372,7 +1392,7 @@ class SickNoteViewControllerTest {
         when(sickNoteService.getById(SOME_SICK_NOTE_ID)).thenReturn(Optional.of(SickNote.builder().person(new Person()).status(ACTIVE).build()));
 
         assertThatThrownBy(() ->
-                perform(post("/web/sicknote/" + SOME_SICK_NOTE_ID + "/edit"))
+            perform(post("/web/sicknote/" + SOME_SICK_NOTE_ID + "/edit"))
         ).hasCauseInstanceOf(AccessDeniedException.class);
     }
 
diff --git a/src/test/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/extend/SickNoteExtendViewControllerTest.java b/src/test/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/extend/SickNoteExtendViewControllerTest.java
index 6c104b959..d321aaca1 100644
--- a/src/test/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/extend/SickNoteExtendViewControllerTest.java
+++ b/src/test/java/org/synyx/urlaubsverwaltung/sicknote/sicknote/extend/SickNoteExtendViewControllerTest.java
@@ -9,6 +9,7 @@ import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
 import org.springframework.test.web.servlet.ResultActions;
 import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
+import org.synyx.urlaubsverwaltung.period.DayLength;
 import org.synyx.urlaubsverwaltung.person.Person;
 import org.synyx.urlaubsverwaltung.person.PersonService;
 import org.synyx.urlaubsverwaltung.person.Role;
@@ -25,10 +26,13 @@ import java.util.Optional;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoInteractions;
 import static org.mockito.Mockito.when;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
 import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standaloneSetup;
+import static org.synyx.urlaubsverwaltung.period.DayLength.FULL;
 import static org.synyx.urlaubsverwaltung.person.Role.BOSS;
 import static org.synyx.urlaubsverwaltung.person.Role.USER;
 
@@ -57,9 +61,35 @@ class SickNoteExtendViewControllerTest {
     @BeforeEach
     void setUp() {
         sut = new SickNoteExtendViewController(personService, workingTimeCalendarService,
-             sickNoteService, sickNoteExtensionService,
-             sickNoteExtensionInteractionService,
-             sickNoteExtendValidator, dateFormatAware, clock);
+            sickNoteService, sickNoteExtensionService,
+            sickNoteExtensionInteractionService,
+            sickNoteExtendValidator, dateFormatAware, clock);
+    }
+
+    @ParameterizedTest
+    @EnumSource(value = DayLength.class, names = {"FULL", "ZERO"}, mode = EnumSource.Mode.EXCLUDE)
+    void ensuresSickNoteExtendViewIsNotDisplayedForSickNotes(final DayLength dayLength) throws Exception {
+
+        final Person person = new Person();
+        person.setId(1L);
+        person.setPermissions(List.of(USER));
+
+        when(personService.getSignedInUser()).thenReturn(person);
+
+        final SickNote currentActiveSickNote = SickNote.builder()
+            .id(1L)
+            .person(person)
+            .dayLength(dayLength)
+            .build();
+
+        when(sickNoteService.getSickNoteOfYesterdayOrLastWorkDay(person))
+            .thenReturn(Optional.of(currentActiveSickNote));
+
+        perform(
+            get("/web/sicknote/extend")
+        )
+            .andExpect(status().isOk())
+            .andExpect(view().name("sicknote/sick_note_extended_not_found"));
     }
 
     @ParameterizedTest
@@ -77,6 +107,7 @@ class SickNoteExtendViewControllerTest {
         final SickNote currentActiveSickNote = SickNote.builder()
             .id(1L)
             .person(person)
+            .dayLength(FULL)
             .build();
 
         when(sickNoteService.getSickNoteOfYesterdayOrLastWorkDay(person))
@@ -108,6 +139,7 @@ class SickNoteExtendViewControllerTest {
         final SickNote currentActiveSickNote = SickNote.builder()
             .id(1L)
             .person(person)
+            .dayLength(FULL)
             .build();
 
         when(sickNoteService.getSickNoteOfYesterdayOrLastWorkDay(person))
@@ -125,6 +157,36 @@ class SickNoteExtendViewControllerTest {
         verifyNoInteractions(sickNoteExtensionService);
     }
 
+    @ParameterizedTest
+    @EnumSource(value = DayLength.class, names = {"FULL", "ZERO"}, mode = EnumSource.Mode.EXCLUDE)
+    void ensureExtensionDoesNoRedirectOnHalfDaySickNotes(final DayLength dayLength) throws Exception {
+
+        final Person person = new Person();
+        person.setId(1L);
+        person.setPermissions(List.of(USER, BOSS));
+
+        when(personService.getSignedInUser()).thenReturn(person);
+
+        final SickNote currentActiveSickNote = SickNote.builder()
+            .id(1L)
+            .person(person)
+            .dayLength(dayLength)
+            .build();
+
+        when(sickNoteService.getSickNoteOfYesterdayOrLastWorkDay(person))
+            .thenReturn(Optional.of(currentActiveSickNote));
+
+        perform(
+            post("/web/sicknote/extend")
+                .param("sickNoteId", "1")
+                .param("endDate", "2024-09-27")
+        )
+            .andExpect(status().isOk())
+            .andExpect(view().name("sicknote/sick_note_extended_not_found"));
+
+        verifyNoInteractions(sickNoteExtensionService);
+    }
+
     private ResultActions perform(MockHttpServletRequestBuilder builder) throws Exception {
         return standaloneSetup(sut).build().perform(builder);
     }