use of org.glassfish.jersey.internal.util.collection.MultivaluedStringMap in project dropwizard by dropwizard.
the class OptionalFormParamResourceTest method shouldReturnDefaultMessageWhenMessageIsNotPresent.
@Test
public void shouldReturnDefaultMessageWhenMessageIsNotPresent() throws IOException {
final String defaultMessage = "Default Message";
final Response response = target("/optional/message").request().post(Entity.form(new MultivaluedStringMap()));
assertThat(response.readEntity(String.class)).isEqualTo(defaultMessage);
}
use of org.glassfish.jersey.internal.util.collection.MultivaluedStringMap in project dropwizard by dropwizard.
the class OptionalFormParamResourceTest method shouldReturnDefaultMessageWhenMyMessageIsNotPresent.
@Test
public void shouldReturnDefaultMessageWhenMyMessageIsNotPresent() throws IOException {
final String defaultMessage = "My Default Message";
final Response response = target("/optional/my-message").request().post(Entity.form(new MultivaluedStringMap()));
assertThat(response.readEntity(String.class)).isEqualTo(defaultMessage);
}
use of org.glassfish.jersey.internal.util.collection.MultivaluedStringMap in project dropwizard by dropwizard.
the class OptionalFormParamResourceTest method shouldReturnDefaultUUIDWhenUUIDIsNotPresent.
@Test
public void shouldReturnDefaultUUIDWhenUUIDIsNotPresent() throws IOException {
final String defaultUUID = "d5672fa8-326b-40f6-bf71-d9dacf44bcdc";
final Response response = target("/optional/uuid").request().post(Entity.form(new MultivaluedStringMap()));
assertThat(response.readEntity(String.class)).isEqualTo(defaultUUID);
}
use of org.glassfish.jersey.internal.util.collection.MultivaluedStringMap in project dropwizard by dropwizard.
the class OptionalFormParamResourceTest method shouldReturnDefaultMessageWhenMyMessageIsNotPresent.
@Test
public void shouldReturnDefaultMessageWhenMyMessageIsNotPresent() throws IOException {
final String defaultMessage = "My Default Message";
final Response response = target("/optional/my-message").request().post(Entity.form(new MultivaluedStringMap()));
assertThat(response.readEntity(String.class)).isEqualTo(defaultMessage);
}
use of org.glassfish.jersey.internal.util.collection.MultivaluedStringMap in project jersey by jersey.
the class EntityTypesTest method testFormMultivaluedMapRepresentation.
@Test
public void testFormMultivaluedMapRepresentation() {
final MultivaluedMap<String, String> fp = new MultivaluedStringMap();
fp.add("Email", "johndoe@gmail.com");
fp.add("Passwd", "north 23AZ");
fp.add("service", "cl");
fp.add("source", "Gulp-CalGul-1.05");
fp.add("source", "foo.java");
fp.add("source", "bar.java");
final WebTarget target = target("FormMultivaluedMapResource");
final MultivaluedMap _fp = target.request().post(Entity.entity(fp, "application/x-www-form-urlencoded"), MultivaluedMap.class);
assertEquals(fp, _fp);
}
Aggregations