Fix UrlPathHelper#shouldRemoveSemicolonContent() (#27303)
The checkReadOnly() method should only be called from methods that modify properties to prevent modification of read-only instances. Fixes #27256
This commit is contained in:
@@ -22,6 +22,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.web.testfixture.servlet.MockHttpServletRequest;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatCode;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link UrlPathHelper}.
|
||||
@@ -165,6 +166,11 @@ public class UrlPathHelperTests {
|
||||
assertThat(helper.getLookupPathForRequest(request)).isEqualTo("/welcome.html;c=d");
|
||||
}
|
||||
|
||||
@Test // gh-27303
|
||||
public void shouldRemoveSemicolonContentWithReadOnlyInstance() {
|
||||
assertThatCode(UrlPathHelper.defaultInstance::shouldRemoveSemicolonContent).doesNotThrowAnyException();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// suite of tests root requests for default servlets (SRV 11.2) on Websphere vs Tomcat and other containers
|
||||
|
||||
Reference in New Issue
Block a user