@Test public void testGetProvideCompletionItemsFunction() { final JavaScriptObject expectedSuggestions = mock(JavaScriptObject.class); final JSONObject expectedJSONObjectSuggestions = mock(JSONObject.class); final JSONArray suggestions = mock(JSONArray.class); doReturn(expectedJSONObjectSuggestions).when(factory).makeJSONObject(); doReturn(suggestions).when(factory).getSuggestions(variableSuggestions); when(expectedJSONObjectSuggestions.getJavaScriptObject()).thenReturn(expectedSuggestions); final JavaScriptObject actualSuggestions = factory.getProvideCompletionItemsFunction(variableSuggestions).call(); verify(expectedJSONObjectSuggestions).put("suggestions", suggestions); assertEquals(expectedSuggestions, actualSuggestions); }
ProvideCompletionItemsFunction getProvideCompletionItemsFunction(final MonacoFEELVariableSuggestions variableSuggestions) { return () -> { final JSONObject suggestions = makeJSONObject(); suggestions.put("suggestions", getSuggestions(variableSuggestions)); return suggestions.getJavaScriptObject(); }; }
MonacoPropertiesFactory { ProvideCompletionItemsFunction getProvideCompletionItemsFunction(final MonacoFEELVariableSuggestions variableSuggestions) { return () -> { final JSONObject suggestions = makeJSONObject(); suggestions.put("suggestions", getSuggestions(variableSuggestions)); return suggestions.getJavaScriptObject(); }; } }
MonacoPropertiesFactory { ProvideCompletionItemsFunction getProvideCompletionItemsFunction(final MonacoFEELVariableSuggestions variableSuggestions) { return () -> { final JSONObject suggestions = makeJSONObject(); suggestions.put("suggestions", getSuggestions(variableSuggestions)); return suggestions.getJavaScriptObject(); }; }  }
MonacoPropertiesFactory { ProvideCompletionItemsFunction getProvideCompletionItemsFunction(final MonacoFEELVariableSuggestions variableSuggestions) { return () -> { final JSONObject suggestions = makeJSONObject(); suggestions.put("suggestions", getSuggestions(variableSuggestions)); return suggestions.getJavaScriptObject(); }; }  JavaScriptObject getConstructionOptions(); JavaScriptObject getThemeData(); JSONArray getRules(); JavaScriptObject getCompletionItemProvider(final MonacoFEELVariableSuggestions variableSuggestions); JavaScriptObject getLanguageDefinition(); JSONValue getTokenizer(); JSONArray getRoot(); JSONArray row(final String pattern,
                         final String name); JavaScriptObject getLanguage(); }
MonacoPropertiesFactory { ProvideCompletionItemsFunction getProvideCompletionItemsFunction(final MonacoFEELVariableSuggestions variableSuggestions) { return () -> { final JSONObject suggestions = makeJSONObject(); suggestions.put("suggestions", getSuggestions(variableSuggestions)); return suggestions.getJavaScriptObject(); }; }  JavaScriptObject getConstructionOptions(); JavaScriptObject getThemeData(); JSONArray getRules(); JavaScriptObject getCompletionItemProvider(final MonacoFEELVariableSuggestions variableSuggestions); JavaScriptObject getLanguageDefinition(); JSONValue getTokenizer(); JSONArray getRoot(); JSONArray row(final String pattern,
                         final String name); JavaScriptObject getLanguage(); static final String FEEL_LANGUAGE_ID; static final String FEEL_THEME_ID; }