use of org.opentosca.toscana.core.transformation.TransformationDao in project TOSCAna by StuPro-TOSCAna.
the class CsarFilesystemDaoTest method returnedCsarHasPopulatedTransformations.
@Test
public void returnedCsarHasPopulatedTransformations() {
// test whether CsarDao calls TransformationDao internally to populate list of transformations
String identifier = createFakeCsarDirectories(1)[0];
Csar csar = new CsarImpl(new File(""), identifier, logMock());
csarDao = new CsarFilesystemDao(preferences, transformationDao);
List<Transformation> transformations = TestPlugins.PLATFORMS.stream().map(platform -> new TransformationImpl(csar, platform, logMock(), modelMock())).collect(Collectors.toList());
when(transformationDao.find(any())).thenReturn(transformations);
csarDao.init();
Optional<Csar> result = csarDao.find(identifier);
assertTrue(result.isPresent());
assertEquals(TestPlugins.PLATFORMS.size(), result.get().getTransformations().size());
}
Aggregations