EsxCloudVmx { public static EsxCloudVmx fromImageSettings(Map<String, String> imageSettings) { EsxCloudVmx ecv = new EsxCloudVmx(); for (Map.Entry<String, String> imageSetting : imageSettings.entrySet()) { if (imageSetting.getValue() == null) { ecv.parameters.add(new EsxCloudVmx.Property(imageSetting.getKey())); } else { ecv.configuration.put(imageSetting.getKey(), imageSetting.getValue()); } } return ecv; } EsxCloudVmx(); static Map<String, String> toImageSettings(EsxCloudVmx ecv); static EsxCloudVmx fromImageSettings(Map<String, String> imageSettings); @Override boolean equals(Object o); @Override int hashCode(); final Map<String, String> configuration; final List<Property> parameters; }
@Test public void testFromImageSettings() { assertThat(EsxCloudVmx.fromImageSettings(createImageSettings()), is(createEsxCloudVmx())); }