Fix failing test
This commit is contained in:
@@ -34,6 +34,9 @@ public class BoshCommandStemcellsProvider extends BoshCommandBasedModelProvider<
|
||||
private static final YamlTraversal STEMCELL_OSS = STEMCELLS
|
||||
.thenValAt("os");
|
||||
|
||||
private static final YamlTraversal STEMCELL_VERSIONS = STEMCELLS
|
||||
.thenValAt("version");
|
||||
|
||||
@Override
|
||||
public StemcellsModel getModel(DynamicSchemaContext dc) throws Exception {
|
||||
JSONCursor cursor = new JSONCursor(getJsonTree());
|
||||
@@ -80,6 +83,11 @@ public class BoshCommandStemcellsProvider extends BoshCommandBasedModelProvider<
|
||||
public Collection<String> getStemcellOss() {
|
||||
return getNames(STEMCELL_OSS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getVersions() {
|
||||
return getNames(STEMCELL_VERSIONS);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -19,4 +19,5 @@ public interface StemcellsModel {
|
||||
Collection<String> getStemcellNames();
|
||||
Collection<String> getStemcellOss();
|
||||
Collection<StemcellData> getStemcells();
|
||||
Collection<String> getVersions();
|
||||
}
|
||||
|
||||
@@ -936,13 +936,13 @@ public class BoshEditorTest {
|
||||
editor = harness.newEditor(
|
||||
"stemcells:\n" +
|
||||
"- alias: good\n" +
|
||||
" os: ubuntu-trusty\n" +
|
||||
" os: ubuntu\n" +
|
||||
"- alias: not-so-good\n" +
|
||||
" os: bogus<*>"
|
||||
);
|
||||
editor.ignoreProblem(YamlSchemaProblems.MISSING_PROPERTY);
|
||||
editor.assertProblems(
|
||||
"bogus|unknown 'StemcellOs'. Valid values are: [centos-7, ubuntu-trusty]"
|
||||
"bogus|unknown 'StemcellOs'. Valid values are: [ubuntu, centos]"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,4 +57,10 @@ public class BoshCommandStemcellsProviderTest {
|
||||
provider.getModel(mock(DynamicSchemaContext.class)).getStemcellOss());
|
||||
}
|
||||
|
||||
@Test public void getVersions() throws Exception {
|
||||
assertEquals(ImmutableSet.of("3421.11"),
|
||||
provider.getModel(mock(DynamicSchemaContext.class)).getVersions());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user