File tree Expand file tree Collapse file tree
main/java/com/baeldung/servletinitializer
test/java/com/baeldung/servletinitializer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .baeldung .servletinitializer ;
22
3-
4-
5-
63import java .time .LocalDateTime ;
74
85import org .springframework .boot .SpringApplication ;
1714public class WarInitializerApplication extends SpringBootServletInitializer {
1815
1916 @ Override
20- protected SpringApplicationBuilder configure (SpringApplicationBuilder builder ) {
17+ protected SpringApplicationBuilder configure (SpringApplicationBuilder builder ) {
2118 return builder .sources (WarInitializerApplication .class );
2219 }
23-
24- public static void main (String [] args ) {
20+
21+ public static void main (String [] args ) {
2522 SpringApplication sa = new SpringApplication (WarInitializerApplication .class );
2623 sa .setLogStartupInfo (false );
2724 sa .run (args );
@@ -31,10 +28,9 @@ public static void main (String[] args) {
3128 public static class WarInitializerController {
3229
3330 @ RequestMapping ("/" )
34- public String handler (Model model ) {
35- model .addAttribute ("date" ,
36- LocalDateTime .now ());
31+ public String handler (Model model ) {
32+ model .addAttribute ("date" , LocalDateTime .now ());
3733 return "WarInitializerApplication is up and running!" ;
3834 }
3935 }
40- }
36+ }
Original file line number Diff line number Diff line change @@ -24,9 +24,9 @@ public class WarInitializerApplicationTest {
2424 @ Test
2525 public void whenContextRootUrlIsAccessed_thenStatusIsOk () throws Exception {
2626 mockMvc .perform (get ("/" ))
27- .andExpect (status ().is (200 ));
27+ .andExpect (status ().is (200 ));
2828 }
29-
29+
3030 @ Test
3131 public void whenContextRootUrlIsAccesed_thenCorrectStringIsReturned () throws Exception {
3232 mockMvc .perform (get ("/" ))
You can’t perform that action at this time.
0 commit comments