use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.
the class SearchResourceRequestTest method specialOptionKeyWithExpressionValue.
@Test
public void specialOptionKeyWithExpressionValue() throws Exception {
final Options options = Options.builder().put(OptionKey.SPECIAL, "@field(value)").build();
final Options actual = SearchResourceRequest.processSpecialOptionKey(options, OptionKey.SPECIAL);
assertEquals(Options.builder().put("FIELD", "value").build(), actual);
}
use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.
the class SearchResourceRequestTest method specialOptionKeyWithExpressionValueIncorrectSyntaxNoValue.
@Test
public void specialOptionKeyWithExpressionValueIncorrectSyntaxNoValue() throws Exception {
final Options options = Options.builder().put(OptionKey.SPECIAL, "@field()").build();
final Options actual = SearchResourceRequest.processSpecialOptionKey(options, OptionKey.SPECIAL);
assertTrue(options == actual);
}
use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.
the class SearchResourceRequestTest method specialOptionKeyWithExpressionValueIncorrectSyntaxNoValueBracket.
@Test
public void specialOptionKeyWithExpressionValueIncorrectSyntaxNoValueBracket() throws Exception {
final Options options = Options.builder().put(OptionKey.SPECIAL, "@field").build();
final Options actual = SearchResourceRequest.processSpecialOptionKey(options, OptionKey.SPECIAL);
assertTrue(options == actual);
}
use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.
the class SearchResourceRequestTest method specialOptionKeyWithExpressionValueIncorrectSyntaxOnlyLeadingChar.
@Test
public void specialOptionKeyWithExpressionValueIncorrectSyntaxOnlyLeadingChar() throws Exception {
final Options options = Options.builder().put(OptionKey.SPECIAL, "@").build();
final Options actual = SearchResourceRequest.processSpecialOptionKey(options, OptionKey.SPECIAL);
assertTrue(options == actual);
}
use of com.b2international.commons.options.Options in project snow-owl by b2ihealthcare.
the class SearchResourceRequestTest method specialOptionKeyWithExpressionValueOtherOptionKeys.
@Test
public void specialOptionKeyWithExpressionValueOtherOptionKeys() throws Exception {
final Options options = Options.builder().put(OptionKey.SPECIAL, "@field(value)").put("OTHER", "filter").build();
final Options actual = SearchResourceRequest.processSpecialOptionKey(options, OptionKey.SPECIAL);
assertEquals(Options.builder().put("FIELD", "value").put("OTHER", "filter").build(), actual);
}
Aggregations