use of org.eclipse.che.plugin.docker.client.json.network.Network in project che by eclipse.
the class DockerConnectorTest method shouldBeAbleToInspectNetworkWithParams.
@Test
public void shouldBeAbleToInspectNetworkWithParams() throws Exception {
// given
Network originNetwork = createNetwork();
ByteArrayInputStream inputStream = new ByteArrayInputStream(GSON.toJson(originNetwork).getBytes());
doReturn(inputStream).when(dockerResponse).getInputStream();
// when
Network actual = dockerConnector.inspectNetwork(InspectNetworkParams.create(originNetwork.getId()));
// then
assertEquals(actual, originNetwork);
verify(dockerConnectionFactory).openConnection(any(URI.class));
verify(dockerConnection).method(REQUEST_METHOD_GET);
verify(dockerConnection).path("/networks/" + originNetwork.getId());
verify(dockerConnection).request();
verify(dockerResponse).getStatus();
verify(dockerResponse).getInputStream();
}
Aggregations