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_has_multiple_values.
@Test
public void should_create_error_message_for_uri_parameter_without_value_that_has_multiple_values() throws Exception {
URI uri = new URI("http://assertj.org/news?article=10");
String error = shouldHaveParameter(uri, "article", null, newArrayList("10", "11")).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news?article=10>%n" + "to have parameter:%n" + " <\"article\">%n" + "with no value, but parameter had 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_uri_with_no_parameter_that_has_one_without_value.
@Test
public void should_create_error_message_for_uri_with_no_parameter_that_has_one_without_value() throws Exception {
URI uri = new URI("http://assertj.org/news?article");
String error = shouldHaveNoParameter(uri, "article", null, 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" + "with no value, but did"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHavePath_create_Test method should_create_error_message_for_uri.
@Test
public void should_create_error_message_for_uri() throws Exception {
String error = shouldHavePath(new URI("http://assertj.org/news"), "/foo").create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting path of%n" + " <http://assertj.org/news>%n" + "to be:%n" + " <\"/foo\">%n" + "but was:%n" + " <\"/news\">"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHavePath_create_Test method should_create_error_message_for_uri_has_no_path.
@Test
public void should_create_error_message_for_uri_has_no_path() throws Exception {
URI uri = new URI("http://assertj.org/news?type=beta");
String error = shouldHavePath(uri, null).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news?type=beta>%n" + "not to have a path but had:%n" + " <\"/news\">"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHavePort_create_Test method should_create_error_message_for_url_has_no_port.
@Test
public void should_create_error_message_for_url_has_no_port() throws Exception {
URL url = new URL("http://assertj.org:8080/news");
String error = shouldHavePort(url, -1).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org:8080/news>%n" + "not to have a port but had:%n" + " <8080>"));
}
Aggregations