@@ -51,15 +51,6 @@ public void testExceptionHandler() throws Exception {
5151 .andExpect (content ().string ("View1\n " ));
5252 }
5353
54- @ Test
55- public void testExceptionHandlerWithHtmxView () throws Exception {
56-
57- mockMvc .perform (get ("/throw-exception-htmx-view" ).headers (htmxRequest ()))
58- .andExpect (status ().isOk ())
59- .andExpect (header ().string ("HX-Retarget" , "#container" ))
60- .andExpect (content ().string ("View1\n " ));
61- }
62-
6354 @ Test
6455 public void testExceptionHandlerUsingAnnotation () throws Exception {
6556
@@ -69,15 +60,6 @@ public void testExceptionHandlerUsingAnnotation() throws Exception {
6960 .andExpect (content ().string ("View1\n " ));
7061 }
7162
72- @ Test
73- public void testExceptionHandlerUsingAnnotationWithHtmxView () throws Exception {
74-
75- mockMvc .perform (get ("/throw-exception-annotated-htmx-view" ).headers (htmxRequest ()))
76- .andExpect (status ().isOk ())
77- .andExpect (header ().string ("HX-Reswap" , "none" ))
78- .andExpect (content ().string ("View1\n " ));
79- }
80-
8163 @ Test
8264 public void testLocationRedirect () throws Exception {
8365
@@ -153,14 +135,6 @@ public void testLocationRedirectWithFlashAttributes() throws Exception {
153135 .andExpect (flash ().attribute ("flash" , "test" ));
154136 }
155137
156- @ Test
157- public void testMultipleViews () throws Exception {
158-
159- mockMvc .perform (get ("/multiple-views" ).headers (htmxRequest ()))
160- .andExpect (status ().isOk ())
161- .andExpect (content ().string ("View1\n View2\n " ));
162- }
163-
164138 @ Test
165139 public void testRedirect () throws Exception {
166140
@@ -199,7 +173,8 @@ public void testRedirectViewNamePrefixFlashAttributes() throws Exception {
199173 mockMvc .perform (get ("/contextpath/redirect-view-name-prefix-flash-attributes" ).contextPath ("/contextpath" ).headers (htmxRequest ()))
200174 .andExpect (status ().isOk ())
201175 .andExpect (header ().string ("HX-Redirect" , "/contextpath/test" ))
202- .andExpect (flash ().attribute ("flash" , "test" ));;
176+ .andExpect (flash ().attribute ("flash" , "test" ));
177+ ;
203178 }
204179
205180 @ Test
@@ -235,14 +210,6 @@ public void testRefreshViewName() throws Exception {
235210 .andExpect (header ().string ("HX-Refresh" , HtmxValue .TRUE ));
236211 }
237212
238- @ Test
239- public void testSingleView () throws Exception {
240-
241- mockMvc .perform (get ("/single-view" ).headers (htmxRequest ()))
242- .andExpect (status ().isOk ())
243- .andExpect (content ().string ("View1\n " ));
244- }
245-
246213 @ Controller
247214 static class TestController {
248215
@@ -254,14 +221,6 @@ public String handleError(RuntimeException ex, HtmxRequest htmxRequest, HtmxResp
254221 return "view1" ;
255222 }
256223
257- @ ExceptionHandler (TestExceptionForHtmxViewHandler .class )
258- public HtmxView handleError (TestExceptionForHtmxViewHandler ex , HtmxRequest htmxRequest , HtmxResponse htmxResponse ) {
259- if (htmxRequest .isHtmxRequest ()) {
260- htmxResponse .setRetarget ("#container" );
261- }
262- return new HtmxView ("view1" );
263- }
264-
265224 @ ExceptionHandler (TestExceptionForAnnotatedHandlerWithAnnotationOverride .class )
266225 @ HxRetarget ("#container" )
267226 public String handleError (TestExceptionForAnnotatedHandlerWithAnnotationOverride ex , HtmxRequest htmxRequest , HtmxResponse htmxResponse ) {
@@ -274,12 +233,6 @@ public String handleError(TestExceptionForAnnotatedHandler ex, HtmxRequest htmxR
274233 return "view1" ;
275234 }
276235
277- @ ExceptionHandler (TestExceptionForAnnotatedHandlerWithHtmxView .class )
278- @ HxReswap (HxSwapType .NONE )
279- public HtmxView handleError (TestExceptionForAnnotatedHandlerWithHtmxView ex , HtmxRequest htmxRequest , HtmxResponse htmxResponse ) {
280- return new HtmxView ("view1" );
281- }
282-
283236 @ HxRequest
284237 @ GetMapping ("/location-redirect" )
285238 public HtmxLocationRedirectView locationRedirect () {
@@ -370,12 +323,6 @@ public HtmxLocationRedirectView locationRedirectWithFlashAttributes(RedirectAttr
370323 return new HtmxLocationRedirectView ("/path" );
371324 }
372325
373- @ HxRequest
374- @ GetMapping ("/multiple-views" )
375- public HtmxView multipleViews () {
376- return new HtmxView ("view1" , "view2" );
377- }
378-
379326 @ HxRequest
380327 @ GetMapping ("/redirect" )
381328 public HtmxRedirectView redirect () {
@@ -430,24 +377,12 @@ public String refreshViewName() {
430377 return "refresh:htmx" ;
431378 }
432379
433- @ HxRequest
434- @ GetMapping ("/single-view" )
435- public HtmxView singleView () {
436- return new HtmxView ("view1" );
437- }
438-
439380 @ HxRequest
440381 @ GetMapping ("/throw-exception" )
441382 public void throwException () {
442383 throw new RuntimeException ();
443384 }
444385
445- @ HxRequest
446- @ GetMapping ("/throw-exception-htmx-view" )
447- public void throwExceptionHtmxView () {
448- throw new TestExceptionForHtmxViewHandler ();
449- }
450-
451386 @ HxRequest
452387 @ GetMapping ("/throw-exception-annotation-override" )
453388 @ HxRetarget ("controller-method-target" )
@@ -461,26 +396,12 @@ public void throwExceptionForAnnotatedHandler() {
461396 throw new TestExceptionForAnnotatedHandler ();
462397 }
463398
464- @ HxRequest
465- @ GetMapping ("/throw-exception-annotated-htmx-view" )
466- public void throwExceptionForAnnotatedHandlerWithHtmxView () {
467- throw new TestExceptionForAnnotatedHandlerWithHtmxView ();
468- }
469-
470- }
471-
472- static class TestExceptionForHtmxViewHandler extends RuntimeException {
473-
474399 }
475400
476401 static class TestExceptionForAnnotatedHandler extends RuntimeException {
477402
478403 }
479404
480- static class TestExceptionForAnnotatedHandlerWithHtmxView extends RuntimeException {
481-
482- }
483-
484405 static class TestExceptionForAnnotatedHandlerWithAnnotationOverride extends RuntimeException {
485406
486407 }
0 commit comments