Merge branch '6.0.x'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2022 the original author or authors.
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -48,15 +48,12 @@ public class DefaultControllerSpecTests {
|
||||
.exchange()
|
||||
.expectStatus().isOk()
|
||||
.expectBody(String.class).isEqualTo("Success");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void controllerEmptyPath() {
|
||||
new DefaultControllerSpec(new MyController()).build()
|
||||
.get().uri("")
|
||||
.exchange()
|
||||
.expectStatus().isOk()
|
||||
.expectBody(String.class).isEqualTo("Success empty path");
|
||||
.expectBody(String.class).isEqualTo("Success");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -121,19 +118,15 @@ public class DefaultControllerSpecTests {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@RestController
|
||||
private static class MyController {
|
||||
|
||||
@GetMapping("/")
|
||||
@GetMapping
|
||||
public String handleRootPath() {
|
||||
return "Success";
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public String handleEmptyPath() {
|
||||
return "Success empty path";
|
||||
}
|
||||
|
||||
@GetMapping("/exception")
|
||||
public void handleWithError() {
|
||||
throw new IllegalStateException();
|
||||
|
||||
Reference in New Issue
Block a user