File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
src/test/java/com/github/cameltooling/lsp/internal/completion/eip Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ public class EIPChoiceCompletionTest extends AbstractCamelLanguageServerTest {
2222
2323 private static final String FROM_ROUTE = "from(\" timer:foo?period={{timer.period}}\" )" ;
2424 private static final String FROM_ROUTE_WITH_LINE_BREAKS_AND_TABS
25- = "from(\" timer:foo?period={{timer.period}}\" )\n \t .bean()\n .d" ;
25+ = "from(\" timer:foo?period={{timer.period}}\" )\n \t .bean()\n " ;
26+
27+ private static final String FROM_ROUTE_WITH_CHOICE_EIP_MID_WRITTEN
28+ = "from(\" timer:foo?period={{timer.period}}\" )\n \t .ch\n " ;
2629
2730
2831 @ Test
@@ -93,6 +96,20 @@ void testProvideInsertionAfterFromOnCamelRouteWithLineBreaks() throws Exception
9396 assertThat (completionItems ).hasSize (1 );
9497 }
9598
99+ @ Test
100+ void testProvideInsertionMidWritingChoice () throws Exception {
101+ RouteTextBuilder .BlueprintContentWithPosition blueprint =
102+ RouteTextBuilder .createJavaBlueprintCamelRoute (FROM_ROUTE_WITH_CHOICE_EIP_MID_WRITTEN );
103+
104+ List <CompletionItem > completionItems = getCompletionsFor (blueprint .content , blueprint .position );
105+ completionItems = completionItems .stream ().filter (
106+ completionItem -> completionItem .getLabel ().startsWith ("Content Based Router" )
107+ ).collect (Collectors .toList ());
108+
109+
110+ assertThat (completionItems ).hasSize (1 );
111+ }
112+
96113
97114 private List <CompletionItem > getCompletionsFor (String contents , Position position ) throws Exception {
98115 CamelLanguageServer camelLanguageServer = initializeLanguageServer (contents , ".java" );
You can’t perform that action at this time.
0 commit comments