mockserver-client-java/src/main/java/org/mockserver/client/MockServerClient.java
public boolean hasStopped(int attempts, long timeout, TimeUnit timeUnit) {
        try {
            HttpResponse httpResponse = sendRequest(request().withMethod("PUT").withPath(calculatePath("status")));
            if (httpResponse.getStatusCode() == HttpStatusCode.OK_200.code()) {
                if (attempts <= 0) {
                    return false;
                } else {
                    try {
                        timeUnit.sleep(timeout);
                    } catch (InterruptedException e) {
                        // ignore interrupted exception
                    }
                    return hasStopped(attempts - 1, timeout, timeUnit);
                }
            } else {
                return true;
            }
        } catch (SocketConnectionException | IllegalStateException sce) {
            return true;
        }
    }
/**
     * Returns whether server MockServer has stopped, by polling the MockServer a configurable
     * amount of times.  If called too quickly after starting MockServer this may return false
     * because MockServer has not yet started, to ensure MockServer has started use hasStarted()
     */
Returns whether server MockServer has stopped, by polling the MockServer a configurable
amount of times.  If called too quickly after starting MockServer this may return false
because MockServer has not yet started, to ensure MockServer has started use hasStarted()
Returns whether server MockServer has stopped by polling the MockServer a configurable amount of times . If called too quickly after starting MockServer this may return false because MockServer has not yet started to ensure MockServer has started use hasStarted ()
public boolean hasStopped(int attempts, long timeout, TimeUnit timeUnit) {
        try {
            HttpResponse httpResponse = sendRequest(request().withMethod("PUT").withPath(calculatePath("status")));
            if (httpResponse.getStatusCode() == HttpStatusCode.OK_200.code()) {
                if (attempts <= 0) {
                    return false;
                } else {
                    try {
                        timeUnit.sleep(timeout);
                    } catch (InterruptedException e) {
                    }
                    return hasStopped(attempts - 1, timeout, timeUnit);
                }
            } else {
                return true;
            }
        } catch (SocketConnectionException | IllegalStateException sce) {
            return true;
        }
    }
public boolean hasStopped ( int attempts , long timeout , TimeUnit timeUnit ) { try { HttpResponse httpResponse = sendRequest ( request ( ) . withMethod ( "PUT" ) . withPath ( calculatePath ( "status" ) ) ) ; if ( httpResponse . getStatusCode ( ) == HttpStatusCode . OK_200 . code ( ) ) { if ( attempts <= 0 ) { return false ; } else { try { timeUnit . sleep ( timeout ) ; } catch ( InterruptedException e ) { } return hasStopped ( attempts - 1 , timeout , timeUnit ) ; } } else { return true ; } } catch ( SocketConnectionException | IllegalStateException sce ) { return true ; } }
Returns whether server MockServer has stopped, by polling the MockServer a configurable
 amount of times.
Returns whether server MockServer has stopped by polling the MockServer a configurable amount of times .
// ignore interrupted exception