protected DeploymentUnitStatus.State getStreamState(String streamName) {
		PagedResources<StreamDefinitionResource> list = distributedTestSupport.ensureTemplate()
				.streamOperations().list();

		for (StreamDefinitionResource stream : list) {
			if (stream.getName().equals(streamName)) {
				return DeploymentUnitStatus.State.valueOf(stream.getStatus());
			}
		}

		throw new IllegalStateException(String.format("Stream %s not deployed", streamName));
	}
Return the state of the given stream.

@param streamName name of stream for which to obtain state
@return the state of the stream
spring-xd-distributed-test/src/test/java/org/springframework/xd/distributed/test/AbstractDistributedTests.java