@Test public void testSearchWithStrategy() throws Exception { SearchStrategy strategy = SearchStrategy .parse(new ConfigThingy("", "Suchstrategie(test (column \"${suchanfrage1}\"))")); Map<String, Datasource> datasources = Map.of("test", new MockDatasource()); assertNull(Search.search(null, null, null)); assertNull(Search.search("value", null, null)); assertNull(Search.search("value", strategy, null)); QueryResults results = Search.search("value", strategy, datasources); assertEquals(1, results.size()); results = Search.search(".", strategy, datasources); assertEquals(0, results.size()); results = Search.search("*", strategy, datasources); assertEquals(0, results.size()); results = Search.search("value*", strategy, datasources); assertEquals(0, results.size()); results = Search.search("", strategy, datasources); assertEquals(0, results.size()); strategy = SearchStrategy.parse(new ConfigThingy("", "Suchstrategie(test ())")); results = Search.search("value", strategy, datasources); assertEquals(2, results.size()); strategy = SearchStrategy.parse(new ConfigThingy("", "Suchstrategie(test ())")); results = Search.search("value", strategy, datasources); assertEquals(2, results.size()); strategy = SearchStrategy.parse( new ConfigThingy("", "Suchstrategie(test (column \"${suchanfrage1}\") test (column \"${suchanfrage1}3\"))")); datasources = Map.of("test", new MockDatasource("test", List.of("column", "column2"), List .of( new MockDataset("ds", Map.of("column", "value", "column2", "value2")), new MockDataset("ds2", Map.of("column", "value3", "column2", "value4")), new MockDataset("ds2", Map.of("column", "value3", "column2", "value4"))))); results = Search.search("value", strategy, datasources); assertEquals(2, results.size()); }
private Search() { }
Search { private Search() { } }
Search { private Search() { } private  Search(); }
Search { private Search() { } private  Search(); static QueryResults search(String queryString, SearchStrategy searchStrategy,
      Map<String, Datasource> datasources); }
Search { private Search() { } private  Search(); static QueryResults search(String queryString, SearchStrategy searchStrategy,
      Map<String, Datasource> datasources);  }