public static class SingleLinkAltParamResource {
@GET
@Produces("application/atom+xml")
public String getAtom(@Context LinkBuilders builders) {
List<SyndLink> links = new ArrayList<SyndLink>();
SingleLinkBuilder singleLinkBuilder = builders.createSingleLinkBuilder();
singleLinkBuilder.type(MediaType.APPLICATION_ATOM_XML_TYPE).build(links);
assertEquals(1, links.size());
assertLink(links,
null,
MediaType.APPLICATION_ATOM_XML,
"singleLinkAltParam?alt=application%2Fatom%2Bxml");
links.clear();
singleLinkBuilder.type(MediaType.APPLICATION_ATOM_XML_TYPE).addAltParam(false)
.build(links);
assertEquals(1, links.size());
assertLink(links, null, MediaType.APPLICATION_ATOM_XML, "singleLinkAltParam");
links.clear();
singleLinkBuilder.type(MediaType.APPLICATION_ATOM_XML_TYPE).addAltParam(true)
.build(links);
assertEquals(1, links.size());
assertLink(links,
null,
MediaType.APPLICATION_ATOM_XML,
"singleLinkAltParam?alt=application%2Fatom%2Bxml");
links.clear();
singleLinkBuilder.type(MediaType.APPLICATION_ATOM_XML_TYPE).queryParam("alt", "foo")
.build(links);
assertEquals(1, links.size());
assertLink(links, null, MediaType.APPLICATION_ATOM_XML, "singleLinkAltParam?alt=foo");
return "";