Search in sources :

Example 11 with ClientRequests

use of org.springframework.ide.vscode.commons.cloudfoundry.client.ClientRequests in project sts4 by spring-projects.

the class ManifestYamlEditorTest method buildpackContentAssist.

@Test
public void buildpackContentAssist() throws Exception {
    ClientRequests cfClient = cloudfoundry.client;
    CFBuildpack buildPack = Mockito.mock(CFBuildpack.class);
    when(buildPack.getName()).thenReturn("java_buildpack");
    when(cfClient.getBuildpacks()).thenReturn(ImmutableList.of(buildPack));
    CompletionItem completion = assertCompletions("buildpack: <*>", "buildpack: java_buildpack<*>").get(0);
    assertEquals("java_buildpack", completion.getLabel());
    assertEquals("an-org : a-space [test.io]", completion.getDocumentation());
}
Also used : CompletionItem(org.eclipse.lsp4j.CompletionItem) CFBuildpack(org.springframework.ide.vscode.commons.cloudfoundry.client.CFBuildpack) ClientRequests(org.springframework.ide.vscode.commons.cloudfoundry.client.ClientRequests) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 ClientRequests (org.springframework.ide.vscode.commons.cloudfoundry.client.ClientRequests)11 Editor (org.springframework.ide.vscode.languageserver.testharness.Editor)6 CompletionItem (org.eclipse.lsp4j.CompletionItem)5 CFDomain (org.springframework.ide.vscode.commons.cloudfoundry.client.CFDomain)4 CFServiceInstance (org.springframework.ide.vscode.commons.cloudfoundry.client.CFServiceInstance)3 Diagnostic (org.eclipse.lsp4j.Diagnostic)2 CFBuildpack (org.springframework.ide.vscode.commons.cloudfoundry.client.CFBuildpack)2 IOException (java.io.IOException)1 NoTargetsException (org.springframework.ide.vscode.commons.cloudfoundry.client.cftarget.NoTargetsException)1