public String getContainerHostForModulePrefix(String streamName, ModuleType moduleType) {
        Assert.hasText(streamName, "stream name can not be empty nor null");
        String moduleIdPrefix = streamName + "." + moduleType + ".";
        Iterator<ModuleMetadataResource> resourceIter = StreamUtils.getRuntimeModules(adminServer).iterator();
        ArrayList<String> containerIds = new ArrayList<String>();
        while (resourceIter.hasNext()) {
            ModuleMetadataResource resource = resourceIter.next();
            if (resource.getModuleId().startsWith(moduleIdPrefix)) {
                containerIds.add(resource.getContainerId());
            }
        }
        Assert.isTrue(
                containerIds.size() == 1,
                "Test require that module to be deployed to only one container. It was deployed to "
                        + containerIds.size() + " containers");
        return containers.get(containerIds.get(0));
    }
Gets the URL of the container where the module

@param streamName Used construct the module id prefix.
@param moduleType The type of module that we are seeking
@return The URL that contains the module.
spring-xd-integration-test/src/main/java/org/springframework/xd/integration/fixtures/ContainerResolver.java