Search in sources :

Example 1 with ConnectContainer

use of org.eclipse.che.plugin.docker.client.json.network.ConnectContainer in project che by eclipse.

the class DockerConnectorTest method shouldBeAbleToConnectContainerToNetwork.

@Test
public void shouldBeAbleToConnectContainerToNetwork() throws Exception {
    // given
    String netId = "net_id";
    String containerId = "container_id";
    doNothing().when(dockerConnector).connectContainerToNetwork(any(ConnectContainerToNetworkParams.class));
    // when
    dockerConnector.connectContainerToNetwork(netId, containerId);
    // then
    verify(dockerConnector).connectContainerToNetwork(ConnectContainerToNetworkParams.create(netId, new ConnectContainer().withContainer(containerId)));
}
Also used : ConnectContainerToNetworkParams(org.eclipse.che.plugin.docker.client.params.network.ConnectContainerToNetworkParams) Matchers.anyString(org.mockito.Matchers.anyString) ConnectContainer(org.eclipse.che.plugin.docker.client.json.network.ConnectContainer) Test(org.testng.annotations.Test)

Aggregations

ConnectContainer (org.eclipse.che.plugin.docker.client.json.network.ConnectContainer)1 ConnectContainerToNetworkParams (org.eclipse.che.plugin.docker.client.params.network.ConnectContainerToNetworkParams)1 Matchers.anyString (org.mockito.Matchers.anyString)1 Test (org.testng.annotations.Test)1