We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RegexHttpMatcher
http
Given the following parameterized test, the first 3 URLs match, but the last one (http://alice:secret@localhost:) does not.
http://alice:secret@localhost:
class NohttpTests { // Copied from io.spring.nohttp.RegexHttpMatcher private final Pattern pattern = Pattern.compile( "\\b(http\\\\?://[-a-zA-Z0-9+&@/%?=~_|!:,.;]*[-a-zA-Z0-9+&@/%=~_|])"); @ParameterizedTest @ValueSource(strings = { "http://localhost", "http://alice:secret@localhost", "http://alice:secret@localhost:80", "http://alice:secret@localhost:" }) void test(String url) { assertThat(pattern.matcher(url)).as(url).matches(); } }
Note that the last one was taken from Java source code which builds the URL programmatically as follows.
String url = "http://alice:secret@localhost:" + port + "/resource";
The text was updated successfully, but these errors were encountered:
rwinch
No branches or pull requests
Given the following parameterized test, the first 3 URLs match, but the last one (
http://alice:secret@localhost:
) does not.Note that the last one was taken from Java source code which builds the URL programmatically as follows.
The text was updated successfully, but these errors were encountered: