File tree Expand file tree Collapse file tree
steve-api/src/test/java/de/rwth/idsg/steve/web/api
steve-ui-jsp/src/main/java/de/rwth/idsg/steve/web/controller
steve/src/main/java/de/rwth/idsg/steve Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -326,7 +326,9 @@ public void test12() throws Exception {
326326 .contentType (MediaType .APPLICATION_JSON )))
327327 .hasStatusOk ();
328328
329- verify (ocppTagsService ).updateOcppTag (form );
329+ var captor = ArgumentCaptor .forClass (OcppTagForm .class );
330+ verify (ocppTagsService ).updateOcppTag (captor .capture ());
331+ assertThat (captor .getValue ()).usingRecursiveComparison ().isEqualTo (form );
330332 }
331333
332334 @ Test
Original file line number Diff line number Diff line change 1919package de .rwth .idsg .steve .web .controller ;
2020
2121import org .springframework .stereotype .Controller ;
22- import org .springframework .web .bind .annotation .GetMapping ;
2322import org .springframework .web .bind .annotation .RequestMapping ;
23+ import org .springframework .web .bind .annotation .RequestMethod ;
2424
2525/**
2626 * @author Sevket Goekay <sevketgokay@gmail.com>
3030@ RequestMapping ("/" )
3131public class RootRedirectController {
3232
33- @ GetMapping
33+ @ RequestMapping ( method = { RequestMethod . GET , RequestMethod . HEAD })
3434 public String redirectToManager () {
3535 return "redirect:/manager" ;
3636 }
Original file line number Diff line number Diff line change 3636@ Slf4j
3737public class Application {
3838
39+ private final SteveConfiguration config ;
40+ private final LogFileRetriever logFileRetriever ;
3941 private final JettyServer server ;
4042
4143 public Application (SteveConfiguration config , LogFileRetriever logFileRetriever ) {
44+ this .config = config ;
45+ this .logFileRetriever = logFileRetriever ;
4246 this .server = new JettyServer (config );
43- WebConfig .config = config ;
44- WebConfig .logFileRetriever = logFileRetriever ;
47+
4548 }
4649
4750 public static void main (String [] args ) throws Exception {
@@ -83,6 +86,7 @@ public static void main(String[] args) throws Exception {
8386 }
8487
8588 public void start () throws Exception {
89+ WebConfig .initialize (config , logFileRetriever );
8690 server .start ();
8791 }
8892
@@ -92,5 +96,6 @@ public void join() throws Exception {
9296
9397 public void stop () throws Exception {
9498 server .stop ();
99+ WebConfig .clear ();
95100 }
96101}
Original file line number Diff line number Diff line change 4747@ RequiredArgsConstructor
4848public class WebConfig implements WebApplicationInitializer {
4949
50- public static SteveConfiguration config ;
51- public static LogFileRetriever logFileRetriever ;
50+ // TEMP workaround before spring boot migration
51+ private static SteveConfiguration config ;
52+ private static LogFileRetriever logFileRetriever ;
53+
54+ public static synchronized void initialize (SteveConfiguration cfg , LogFileRetriever retriever ) {
55+ if (config != null || logFileRetriever != null ) {
56+ throw new IllegalStateException ("WebConfig already initialized" );
57+ }
58+ config = cfg ;
59+ logFileRetriever = retriever ;
60+ }
61+
62+ public static void clear () {
63+ config = null ;
64+ logFileRetriever = null ;
65+ }
5266
5367 @ Override
5468 public void onStartup (ServletContext servletContext ) throws ServletException {
You can’t perform that action at this time.
0 commit comments