From db6ece78d57a4aabd27f5befe87ddf691c52cb29 Mon Sep 17 00:00:00 2001 From: "nsingh@pivotal.io" Date: Tue, 11 Dec 2018 09:11:02 -0800 Subject: [PATCH] Switch to using `buildpacks` on reconcile tests --- .../manifest/yaml/ManifestYamlEditorTest.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/headless-services/manifest-yaml-language-server/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java b/headless-services/manifest-yaml-language-server/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java index dec1eb4cb..66d2c26d2 100644 --- a/headless-services/manifest-yaml-language-server/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java +++ b/headless-services/manifest-yaml-language-server/src/test/java/org/springframework/ide/vscode/manifest/yaml/ManifestYamlEditorTest.java @@ -1133,7 +1133,8 @@ public class ManifestYamlEditorTest { Editor editor = harness.newEditor( "applications:\n" + "- name: foo\n" + - " buildpack: bad-buildpack\n" + + " buildpacks: \n" + + " - bad-buildpack\n" + " services:\n" + " - bad-service\n" + " bogus: bad" //a token error to make sure reconciler is actually running! @@ -1143,7 +1144,8 @@ public class ManifestYamlEditorTest { editor = harness.newEditor( "applications:\n" + "- name: foo-foo\n" + - " buildpack: java_buildpack\n" + + " buildpacks: \n" + + " - bad-buildpack\n" + " routes:\n" + " - route: foo.blah/fooo\n" ); @@ -1338,7 +1340,7 @@ public class ManifestYamlEditorTest { } @Test - public void buildpackContentAssist() throws Exception { + public void deprecatedBuildpackContentAssist() throws Exception { ClientRequests cfClient = cloudfoundry.client; CFBuildpack buildPack = Mockito.mock(CFBuildpack.class); when(buildPack.getName()).thenReturn("java_buildpack"); @@ -1349,6 +1351,20 @@ public class ManifestYamlEditorTest { assertDocumentation("an-org : a-space [test.io]", completion); } + @Test + public void buildpacksContentAssist() throws Exception { + // Test for newer `buildpacks` property + // See: PT 162499688 + 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("buildpacks: \n - <*>", "- java_buildpack<*>").get(0); + assertEquals("java_buildpack", completion.getLabel()); + assertDocumentation("an-org : a-space [test.io]", completion); + } + @Test public void buildbackContentAssistNoTargets() throws Exception { ClientRequests cfClient = cloudfoundry.client;