}
public void testNegOperator() {
UriTemplateProcessor template =
new BitWorkingUriTemplateProcessor("artifacts{-neg|;|var1,var2}");
String[][] empty = {};
assertMatchTemplate(template, "artifact/", null);
assertMatchTemplate(template, "artifacts", empty);
assertMatchTemplate(template, "artifacts;", empty);
assertMatchTemplate(template, "artifacts;;", null);
HashMap<String, Object> hashMap = new HashMap<String, Object>();
hashMap.put("var1", (String)null);
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var2", (String)null);
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var1", (String)null);
hashMap.put("var2", (String)null);
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var1", "");
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var2", "");
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var1", "");
hashMap.put("var2", "");
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var1", "somevalue");
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var2", "somevalue");
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var2", new String[] {});
assertEquals("instantiate template", "artifacts;", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var2", new String[] {null});
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var2", new String[] {""});
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
hashMap = new HashMap<String, Object>();
hashMap.put("var2", new String[] {"a", "b"});
assertEquals("instantiate template", "artifacts", template.expand(hashMap));
}