Summary
I think there are two inappropriate test samples in Urls_assertHasQuery_Test
and Uris_assertHasQuery_Test
.
Example
In Urls_assertHasQuery_Test
:
java
public void should_fail_if_actual_is_null() {
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> urls.assertHasQuery(info, null,
"http://www.helloworld.org/index.html?type=test")).withMessage(actualIsNull());
}
should be:
java
public void should_fail_if_actual_is_null() {
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> urls.assertHasQuery(info, null,
"type=test")).withMessage(actualIsNull());
}
And in Uris_assertHasQuery_Test
:
java
public void should_fail_if_actual_is_null() {
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> uris.assertHasQuery(info, null,
"http://www.helloworld.org/index.html?type=test")).withMessage(actualIsNull());
}
should be:
java
public void should_fail_if_actual_is_null() {
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> uris.assertHasQuery(info, null,
"type=test")).withMessage(actualIsNull());
}
If this issue is valid, I'd like to create a PR for it.
该提问来源于开源项目:assertj/assertj-core