dto.setName("Template");
dto.setDescription("Template description");
dto.addLink(new RESTLink("diskfile", "http://foo/bar"));
dto.addLink(new RESTLink("datacenter", "http://foo/bar/4"));
Image image = function.apply(wrap(context, VirtualMachineTemplate.class, dto));
verify(regionMap);
verify(dcToLocation);
assertEquals(image.getId(), dto.getId().toString());
assertEquals(image.getName(), dto.getName());
assertEquals(image.getDescription(), dto.getDescription());
assertEquals(image.getUri(), URI.create("http://foo/bar"));
assertEquals(image.getOperatingSystem(), OperatingSystem.builder().description(dto.getName()).build());
}