use of org.springframework.ide.vscode.bosh.models.StemcellsModel in project sts4 by spring-projects.
the class BoshEditorTest method dynamicStemcellOssFromDirector.
@Test
public void dynamicStemcellOssFromDirector() throws Exception {
StemcellsModel stemcellsModel = mock(StemcellsModel.class);
when(stemcellsProvider.getModel(any())).thenReturn(stemcellsModel);
when(stemcellsModel.getStemcellOss()).thenReturn(ImmutableSet.of("ubuntu", "centos"));
// content assist
Editor editor = harness.newEditor("stemcells:\n" + "- os: <*>");
editor.assertContextualCompletions("<*>", "centos<*>", "ubuntu<*>");
// reconcile
editor = harness.newEditor("stemcells:\n" + "- alias: good\n" + " os: ubuntu\n" + "- alias: not-so-good\n" + " os: bogus<*>");
editor.ignoreProblem(YamlSchemaProblems.MISSING_PROPERTY);
editor.assertProblems("bogus|unknown 'StemcellOs'. Valid values are: [ubuntu, centos]");
}
use of org.springframework.ide.vscode.bosh.models.StemcellsModel in project sts4 by spring-projects.
the class BoshEditorTest method dynamicStemcellNamesFromDirector.
@Test
public void dynamicStemcellNamesFromDirector() throws Exception {
StemcellsModel stemcellsModel = mock(StemcellsModel.class);
when(stemcellsProvider.getModel(any())).thenReturn(stemcellsModel);
when(stemcellsModel.getStemcellNames()).thenReturn(ImmutableMultiset.of("bosh-vsphere-esxi-centos-7-go_agent", "bosh-vsphere-esxi-ubuntu-trusty-go_agent"));
// content assist
Editor editor = harness.newEditor("stemcells:\n" + "- alias: blah\n" + " name: <*>");
editor.assertContextualCompletions("<*>", "bosh-vsphere-esxi-centos-7-go_agent<*>", "bosh-vsphere-esxi-ubuntu-trusty-go_agent<*>");
// reconcile
editor = harness.newEditor("stemcells:\n" + "- alias: good\n" + " name: bosh-vsphere-esxi-centos-7-go_agent\n" + "- alias: not-so-good\n" + " name: bogus<*>");
editor.ignoreProblem(YamlSchemaProblems.MISSING_PROPERTY);
editor.assertProblems("bogus|unknown 'StemcellName'. Valid values are: [bosh-vsphere-esxi-centos-7-go_agent, bosh-vsphere-esxi-ubuntu-trusty-go_agent]");
}
Aggregations