use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveParameter_create_Test method should_create_error_message_for_url_parameter_without_value_that_is_missing.
@Test
public void should_create_error_message_for_url_parameter_without_value_that_is_missing() throws Exception {
URL url = new URL("http://assertj.org/news");
String error = shouldHaveParameter(url, "article", null).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news>%n" + "to have parameter:%n" + " <\"article\">%n" + "with no value, but parameter was missing"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveParameter_create_Test method should_create_error_message_for_uri_parameter_without_value_that_is_missing.
@Test
public void should_create_error_message_for_uri_parameter_without_value_that_is_missing() throws Exception {
URI uri = new URI("http://assertj.org/news");
String error = shouldHaveParameter(uri, "article", null).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news>%n" + "to have parameter:%n" + " <\"article\">%n" + "with no value, but parameter was missing"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveParameter_create_Test method should_create_error_message_for_url_with_no_parameter_that_has_one_even_without_value.
@Test
public void should_create_error_message_for_url_with_no_parameter_that_has_one_even_without_value() throws Exception {
URL url = new URL("http://assertj.org/news?article");
String error = shouldHaveNoParameter(url, "article", newArrayList((String) null)).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news?article>%n" + "not to have parameter:%n" + " <\"article\">%n" + "but parameter was present with no value"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveParameter_create_Test method should_create_error_message_for_url_with_no_parameter_that_has_one_with_multiple_values.
@Test
public void should_create_error_message_for_url_with_no_parameter_that_has_one_with_multiple_values() throws Exception {
URL url = new URL("http://assertj.org/news?article=10");
String error = shouldHaveNoParameter(url, "article", newArrayList("10", "11")).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news?article=10>%n" + "not to have parameter:%n" + " <\"article\">%n" + "but parameter was present with values:%n" + " <\"[10, 11]\">"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveParameter_create_Test method should_create_error_message_for_url_with_no_parameter_that_has_one_with_value.
@Test
public void should_create_error_message_for_url_with_no_parameter_that_has_one_with_value() throws Exception {
URL url = new URL("http://assertj.org/news?article=10");
String error = shouldHaveNoParameter(url, "article", newArrayList("10")).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news?article=10>%n" + "not to have parameter:%n" + " <\"article\">%n" + "but parameter was present with value:%n" + " <\"10\">"));
}
Aggregations