@Test(groups = "unit", testName = "OperatingSystemToImageTest")
public class OperatingSystemToImageTest {
@Test
public void testOperatingSystemToImage() {
OperatingSystem operatingSystem = OperatingSystem.builder()
.id("123456789")
.softwareLicense(SoftwareLicense.builder()
.softwareDescription(SoftwareDescription.builder()
.version("12.04-64 Minimal for CCI")
.referenceCode("UBUNTU_12_64")
.longDescription("Ubuntu Linux 12.04 LTS Precise Pangolin - Minimal Install (64 bit)")
.build())
.build())
.build();
Image image = new OperatingSystemToImage().apply(operatingSystem);
assertEquals(image.getId(), operatingSystem.getId());
String referenceCode = operatingSystem.getSoftwareLicense().getSoftwareDescription().getReferenceCode();
assertEquals(image.getDescription(), referenceCode);
assertTrue(image.getOperatingSystem().getFamily().toString().equalsIgnoreCase("UBUNTU"));
assertEquals(image.getOperatingSystem().getVersion(), "12.04");
assertEquals(image.getOperatingSystem().is64Bit(), true);
assertEquals(image.getStatus(), Image.Status.AVAILABLE);