assertThat(json, containsString(expectedLinks));
}
@Test
public void shouldSerializeAllLinksIfThereAreTransitions() {
Relation kill = mock(Relation.class);
when(kill.getName()).thenReturn("kill");
when(kill.getUri()).thenReturn("/kill");
Relation ressurect = mock(Relation.class);
when(ressurect.getName()).thenReturn("ressurect");
when(ressurect.getUri()).thenReturn("/ressurect");
when(builder.getRelations()).thenReturn(Arrays.asList(kill, ressurect));
String json = xstream.toXML(resource);
String expectedLinks = "\"links\": [\n {\n \"rel\": \"kill\",\n \"href\": \"http://www.caelum.com.br/kill\"\n },\n {\n \"rel\": \"ressurect\",\n \"href\": \"http://www.caelum.com.br/ressurect\"\n }\n ]";
assertThat(json, containsString(expectedLinks));