WaitCondition getWaitCondition(String dependentServiceName) {
        Objects.requireNonNull(dependentServiceName, "Dependent service's name may not be null");

        Object dependsOnObj = asObject("depends_on");
        if (dependsOnObj instanceof Map) {
            Map<String, Object> dependsOn = (Map<String, Object>) dependsOnObj;
            Object dependenSvcObj = dependsOn.get(dependentServiceName);

            if (dependenSvcObj instanceof Map) {
                Map<String, String> dependency = (Map<String,String>) dependenSvcObj;

                if (dependency.containsKey("condition")) {
                    String condition = dependency.get("condition");
                    try {
                        return WaitCondition.fromString(condition);
                    } catch (IllegalArgumentException e) {
                        throwIllegalArgumentException("depends_on service \"" + dependentServiceName +
                            "\" has invalid syntax (" + e.getMessage() + ")");
                    }
                }
                throwIllegalArgumentException("depends_on service \"" + dependentServiceName + "\" has invalid syntax (missing condition)");
            }
            throwIllegalArgumentException("depends_on service \"" + dependentServiceName + "\" has invalid syntax (no map)");
        }
        throwIllegalArgumentException("depends_on does not use long syntax, cannot retrieve condition");
        return null;
    }
Extract a required condition of another (dependent) service from this service.
In a compose file following v2.1+ format this looks like this:
<pre>{@code
services:
  web:
    build: .
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_started
}</pre>
If this is the "web" service and the parameter to this method is "db", it will extract
the validated condition via {@link WaitCondition}.

@param dependentServiceName The dependent service's name (not alias!)
@return The waiting condition if valid
@throws IllegalArgumentException When condition cannot be extracted or is invalid
src/main/java/io/fabric8/maven/docker/config/handler/compose/DockerComposeServiceWrapper.java