use of org.eclipse.che.plugin.docker.client.json.ContainerListEntry in project che by eclipse.
the class DockerConnectorTest method shouldCallListContainersWithParametersObject.
@Test
public void shouldCallListContainersWithParametersObject() throws IOException {
ListContainersParams listContainersParams = ListContainersParams.create().withAll(true);
ContainerListEntry containerListEntry = mock(ContainerListEntry.class);
List<ContainerListEntry> expectedListContainers = singletonList(containerListEntry);
doReturn(expectedListContainers).when(dockerConnector).listContainers(listContainersParams);
List<ContainerListEntry> result = dockerConnector.listContainers();
ArgumentCaptor<ListContainersParams> listContainersParamsArgumentCaptor = ArgumentCaptor.forClass(ListContainersParams.class);
verify(dockerConnector).listContainers(listContainersParamsArgumentCaptor.capture());
assertEquals(result, expectedListContainers);
assertEquals(listContainersParamsArgumentCaptor.getValue(), listContainersParams);
}
Aggregations