KEYCLOAK-4719 CLI tests fail when run from within the IDE

This commit is contained in:
Marko Strukelj 2017-04-06 12:46:05 +02:00
parent 859b575a12
commit 0269db0e85

View file

@ -14,6 +14,7 @@ import java.io.OutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/** /**
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a> * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
@ -181,7 +182,11 @@ public abstract class AbstractExec {
} }
public List<String> stderrLines() { public List<String> stderrLines() {
return parseStreamAsLines(new ByteArrayInputStream(stderr.toByteArray())); return filterAgentsOutput(parseStreamAsLines(new ByteArrayInputStream(stderr.toByteArray())));
}
public static List<String> filterAgentsOutput(List<String> lines) {
return lines.stream().filter(line -> !line.contains("JAVA_TOOL_OPTIONS")).collect(Collectors.toList());
} }
public String stderrString() { public String stderrString() {