use of io.restassured.itest.java.objects.Greeting in project rest-assured by rest-assured.
the class ObjectMappingITest method serializesNormalParams.
@Test
public void serializesNormalParams() throws Exception {
final Greeting object = new Greeting();
object.setFirstName("John");
object.setLastName("Doe");
final Greeting actual = given().contentType(ContentType.JSON).param("something", "something").param("serialized", object).when().put("/serializedJsonParameter").as(Greeting.class);
assertThat(actual, equalTo(object));
}
use of io.restassured.itest.java.objects.Greeting in project rest-assured by rest-assured.
the class ObjectMappingITest method whenRequestContentTypeIsXmlThenRestAssuredSerializesToXML.
@Test
public void whenRequestContentTypeIsXmlThenRestAssuredSerializesToXML() throws Exception {
final Greeting object = new Greeting();
object.setFirstName("John");
object.setLastName("Doe");
final Greeting actual = given().contentType(ContentType.XML).and().body(object).when().post("/reflect").as(Greeting.class);
assertThat(object, equalTo(actual));
}
use of io.restassured.itest.java.objects.Greeting in project rest-assured by rest-assured.
the class ObjectMappingITest method whenRequestContentTypeIsJsonAndCharsetIsUsAsciiThenRestAssuredSerializesToJSON.
@Test
public void whenRequestContentTypeIsJsonAndCharsetIsUsAsciiThenRestAssuredSerializesToJSON() throws Exception {
final Greeting object = new Greeting();
object.setFirstName("John");
object.setLastName("Doe");
final Greeting actual = given().contentType("application/json; charset=US-ASCII").and().body(object).when().post("/reflect").as(Greeting.class);
assertThat(object, equalTo(actual));
}
use of io.restassured.itest.java.objects.Greeting in project rest-assured by rest-assured.
the class ObjectMappingITest method whenRequestContentTypeIsXmlAndCharsetIsUsAsciiThenRestAssuredSerializesToJSON.
@Test
public void whenRequestContentTypeIsXmlAndCharsetIsUsAsciiThenRestAssuredSerializesToJSON() throws Exception {
final Greeting object = new Greeting();
object.setFirstName("John");
object.setLastName("Doe");
final Greeting actual = given().contentType("application/xml; charset=US-ASCII").and().body(object).when().post("/reflect").as(Greeting.class);
assertThat(object, equalTo(actual));
}
Aggregations