@Test
public void testContainerShouldStart() throws NotFoundServiceException, IOException {

    DockerBootstrap testcontainer = (DockerBootstrap) HadoopBootstrap.INSTANCE.getService("DOCKER");
    String containerIpAddress = testcontainer.getContainer().getContainerIpAddress();
    Integer firstMappedPort = testcontainer.getContainer().getFirstMappedPort();
    Socket pingSocket = new Socket("localhost", firstMappedPort);
    PrintWriter out = new PrintWriter(pingSocket.getOutputStream(), true);
    BufferedReader in = new BufferedReader(new InputStreamReader(pingSocket.getInputStream()));
    out.println("ping");
    String response = in.readLine();
    out.close();
    in.close();
    pingSocket.close();
    assertThat(response).isEqualTo("42");
    assertThat(containerIpAddress).isEqualTo("localhost");
    assertThat(firstMappedPort).isEqualTo(21300);
}