11package dev .streamx .cli ;
22
33import static dev .streamx .cli .test .tools .ResourcePathResolver .absolutePath ;
4- import static org .assertj .core .api .Assertions .fail ;
54
65import dev .streamx .cli .test .tools .terminal .TerminalCommandRunner ;
76import dev .streamx .cli .test .tools .terminal .process .ShellProcess ;
1110import jakarta .inject .Inject ;
1211import jakarta .inject .Named ;
1312import java .io .IOException ;
14- import java .nio .charset .StandardCharsets ;
1513import java .nio .file .Files ;
1614import java .nio .file .Path ;
1715import java .time .Duration ;
18- import org .apache .commons .io .IOUtils ;
19- import org .apache .commons .lang3 .StringUtils ;
2016import org .eclipse .microprofile .config .inject .ConfigProperty ;
21- import org .jboss .logging .Logger ;
2217import org .junit .jupiter .api .BeforeAll ;
2318import org .junit .jupiter .api .Test ;
2419import org .junit .jupiter .api .TestInstance ;
@@ -72,19 +67,7 @@ public void shouldPublishAndUnpublishPageUsingStreamOperation() {
7267 "Sent com.streamx.blueprints.page.published.v1 event using stream with key 'hello.html'"
7368 );
7469
75- // TODO remove the catch
76- try {
77- validateStreamxPage ("hello.html" , "<b>Hello World!</b>" );
78- } catch (Throwable t ) {
79- String dockerPsOutput = readProcessOutput ("docker ps" );
80- String containerLine = dockerPsOutput .lines ()
81- .filter (line -> line .contains ("web-server-sink" ))
82- .findFirst ().orElseThrow ();
83- String containerId = StringUtils .substringBefore (containerLine , " " );
84- String logs = readProcessOutput ("docker logs " + containerId );
85- Logger log = Logger .getLogger (StreamxCliPublicationIT .class );
86- log .info ("\n ---- DOCKER CONTAINER LOGS ---\n " + logs );
87- }
70+ validateStreamxPage ("hello.html" , "<b>Hello World!</b>" );
8871
8972 runStreamxIngestionCommand (
9073 "stream_v2" ,
@@ -95,18 +78,6 @@ public void shouldPublishAndUnpublishPageUsingStreamOperation() {
9578 validateStreamxPageNotAvailable ("hello.html" );
9679 }
9780
98- private static String readProcessOutput (String command ) {
99- String [] words = command .split (" " );
100- ProcessBuilder builder = new ProcessBuilder (words );
101- builder .redirectErrorStream (true ); // merge STDOUT + STDERR
102- try {
103- Process process = builder .start ();
104- return IOUtils .toString (process .getInputStream (), StandardCharsets .UTF_8 );
105- } catch (IOException ex ) {
106- return fail ("Error reading output of command" , ex );
107- }
108- }
109-
11081 @ Test
11182 public void shouldPublishAndUnpublishPageUsingBatchOperation () {
11283 runStreamxIngestionCommand (
0 commit comments