Browse Source
Throw an exception if actuator is running on the main server port and the base path and an individual mapping are set to '/'. See gh-45251 Signed-off-by: yongjunhong <dev.yongjunh@gmail.com>pull/45268/head
2 changed files with 40 additions and 0 deletions
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
package smoketest.actuator; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.beans.factory.BeanCreationException; |
||||
import org.springframework.boot.SpringApplication; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy; |
||||
|
||||
/** |
||||
* Verifies that an exception is thrown when management and server endpoint paths |
||||
* conflict. |
||||
* |
||||
* @author Yongjun Hong |
||||
*/ |
||||
class ManagementEndpointConflictSmokeTest { |
||||
|
||||
@Test |
||||
void shouldThrowExceptionWhenManagementAndServerPathsConflict() { |
||||
assertThatThrownBy(() -> { |
||||
SpringApplication.run(SampleActuatorApplication.class, "--management.endpoints.web.base-path=/", |
||||
"--management.endpoints.web.path-mapping.health=/"); |
||||
}).isInstanceOf(BeanCreationException.class) |
||||
.hasMessageContaining("Management endpoints and endpoint path are both mapped to '/'"); |
||||
} |
||||
|
||||
} |
||||
Loading…
Reference in new issue