use of br.com.caelum.restbucks.model.Item in project restfulie-java by caelum.
the class MappingConfigTest method shouldSerializeSimpleOrder.
@Test
public void shouldSerializeSimpleOrder() {
String expected = "<?xml version='1.0' encoding='utf-8'?>" + "<order>" + "<location>takeAway</location>" + "<items></items>" + "<status>unpaid</status>" + "</order>";
Resources resources = new MappingConfig().getServer();
Order order = new Order("unpaid", new ArrayList<Item>(), Location.takeAway);
StringWriter w = new StringWriter();
resources.getSerializerFor(w, order).serialize();
assertEquals(expected, w.getBuffer().toString());
}
Aggregations