Created
January 16, 2014 20:04
-
-
Save hamnis/8462394 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class QueriesTest { | |
@Test | |
public void findCreatedQuery() throws Exception { | |
Query query = Query.create(new URITemplateTarget("http://example.com{?q}"), "filter", Optional.<String>none(), Collections.singletonList(Property.template("q"))); | |
Collection collection = Collection.builder().addQuery(query).build(); | |
Query filter = collection.queryByRel("filter").get(); | |
assertThat(URI.create("http://example.com"), equalTo(filter.expand())); | |
assertThat(URI.create("http://example.com?q=faff"), equalTo(filter.expand(Collections.singletonList(Property.value("q", "faff"))))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment