Search in sources :

Example 6 with Options

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);
}
Also used : Options(com.b2international.commons.options.Options) Test(org.junit.Test)

Example 7 with Options

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);
}
Also used : Options(com.b2international.commons.options.Options) Test(org.junit.Test)

Example 8 with Options

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);
}
Also used : Options(com.b2international.commons.options.Options) Test(org.junit.Test)

Example 9 with Options

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);
}
Also used : Options(com.b2international.commons.options.Options) Test(org.junit.Test)

Example 10 with Options

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);
}
Also used : Options(com.b2international.commons.options.Options) Test(org.junit.Test)

Aggregations

Options (com.b2international.commons.options.Options)57 List (java.util.List)15 Collectors (java.util.stream.Collectors)14 Set (java.util.Set)13 ExtendedLocale (com.b2international.commons.http.ExtendedLocale)11 BranchContext (com.b2international.snowowl.core.domain.BranchContext)11 SnomedConcept (com.b2international.snowowl.snomed.core.domain.SnomedConcept)11 SnomedConceptRequestCache (com.b2international.snowowl.snomed.datastore.request.SnomedConceptRequestCache)11 Test (org.junit.Test)9 SnomedReferenceSetMember (com.b2international.snowowl.snomed.core.domain.refset.SnomedReferenceSetMember)8 Map (java.util.Map)8 Concepts (com.b2international.snowowl.snomed.common.SnomedConstants.Concepts)7 SnomedConcepts (com.b2international.snowowl.snomed.core.domain.SnomedConcepts)7 BadRequestException (com.b2international.commons.exceptions.BadRequestException)6 ResourceURI (com.b2international.snowowl.core.ResourceURI)6 RepositoryContext (com.b2international.snowowl.core.domain.RepositoryContext)6 SnomedRelationship (com.b2international.snowowl.snomed.core.domain.SnomedRelationship)6 SnomedRequests (com.b2international.snowowl.snomed.datastore.request.SnomedRequests)6 Multimaps (com.google.common.collect.Multimaps)6 Collection (java.util.Collection)6