use of org.opentosca.toscana.plugins.kubernetes.docker.mapper.util.DataContainer in project TOSCAna by StuPro-TOSCAna.
the class MapperTest method init.
public static BaseImageMapper init() throws Exception {
ObjectMapper mapper = new ObjectMapper();
InputStream in = BaseImageMapper.class.getClassLoader().getResourceAsStream("kubernetes/base-image-mapper/image-map.json");
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.copy(in, out);
Preferences preferences = mock(Preferences.class);
when(preferences.getDataDir()).thenReturn(staticTmpDir);
TagStorage tagStorage = new TagStorage(preferences);
BaseImageMapper baseImageMapper = new BaseImageMapper(new DockerBaseImages[] { ALPINE, DEBIAN, UBUNTU }, tagStorage);
DataContainer data = mapper.readValue(new String(out.toByteArray()), DataContainer.class);
baseImageMapper.setImageMap(data.data);
return baseImageMapper;
}
Aggregations