Search in sources :

Example 1 with CsarService

use of org.opentosca.toscana.core.csar.CsarService in project TOSCAna by StuPro-TOSCAna.

the class TransformationControllerTest method mockCsarService.

private void mockCsarService() {
    csarService = mock(CsarService.class);
    List<Csar> csars = new ArrayList<>();
    when(csarService.getCsar(anyString())).thenReturn(Optional.empty());
    for (String name : CSAR_NAMES) {
        Csar csar = new CsarImpl(TestCsars.Testing.EMPTY_TOPOLOGY_TEMPLATE, name, logMock());
        when(csarService.getCsar(name)).thenReturn(Optional.of(csar));
    }
    when(csarService.getCsars()).thenReturn(csars);
}
Also used : Csar(org.opentosca.toscana.core.csar.Csar) ArrayList(java.util.ArrayList) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) CsarImpl(org.opentosca.toscana.core.csar.CsarImpl) CsarService(org.opentosca.toscana.core.csar.CsarService)

Aggregations

ArrayList (java.util.ArrayList)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1 Csar (org.opentosca.toscana.core.csar.Csar)1 CsarImpl (org.opentosca.toscana.core.csar.CsarImpl)1 CsarService (org.opentosca.toscana.core.csar.CsarService)1