Skip to content
Snippets Groups Projects
Commit 5946657c authored by Christoph Thelen's avatar Christoph Thelen
Browse files

Added mehods to directly support arrays

parent 7a6f7327
Branches
Tags
No related merge requests found
......@@ -34,11 +34,19 @@ public class NovaView extends View {
this.startKey = quote(key);
}
public void setStartKeyArray(String key) {
this.startKey = encode("[\"" + key + "\"]");
}
@Override
public void setEndKey(String key) {
this.endKey = quote(key);
}
public void setEndKeyArray(String key) {
this.endKey = encode("[\"" + key + "\"]");
}
public void setStartKey(String... keys) {
this.startKey = toJsonArray(keys);
}
......
......@@ -48,6 +48,20 @@ public class NovaViewTest {
assertEncodedEquals("startkey", "\"foo\"", v.getQueryString());
}
@Test
public void setStartKeyShouldAcceptSingleArgumentArray() {
NovaView v = new NovaView(null);
v.setStartKeyArray("foo");
assertEncodedEquals("startkey", "[\"foo\"]", v.getQueryString());
}
@Test
public void setEndKeyShouldAcceptSingleArgumentArray() {
NovaView v = new NovaView(null);
v.setEndKeyArray("foo");
assertEncodedEquals("endkey", "[\"foo\"]", v.getQueryString());
}
@Test
public void setEndKeyShouldAcceptSingleArgument() {
NovaView v = new NovaView(null);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment