public static boolean waitForStreamDeployment(String streamName, URL adminServer, int waitTime) {
		boolean result = isStreamDeployed(streamName, adminServer);
		long timeout = System.currentTimeMillis() + waitTime;
		while (!result && System.currentTimeMillis() < timeout) {
			try {
				Thread.sleep(1000);
			}
			catch (InterruptedException e) {
				Thread.currentThread().interrupt();
				throw new IllegalStateException(e.getMessage(), e);
			}
			result = isStreamDeployed(streamName, adminServer);
		}

		return result;
	}
Waits up to the wait time for a stream to be deployed.

@param streamName The name of the stream to be evaluated.
@param adminServer The admin server URL that will be queried.
@param waitTime the amount of time in millis to wait.
@return true if the stream is deployed else false.
spring-xd-integration-test/src/main/java/org/springframework/xd/integration/util/StreamUtils.java