Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Jan 23, 2025
1 parent 56c3889 commit f16dd10
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,10 @@ public final class TestApplicationRunner {
private final @NonNull String bootstrapServers;
private final @NonNull SchemaRegistryEnv schemaRegistryEnv;

private static Thread start(final Runnable runnable) {
final Thread thread = new Thread(runnable);
final UncaughtExceptionHandler handler = new CapturingUncaughtExceptionHandler();
thread.setUncaughtExceptionHandler(handler);
thread.start();
return thread;
}

public Thread run(final KafkaStreamsApplication<? extends StreamsApp> app, final String[] args) {
public void run(final KafkaStreamsApplication<? extends StreamsApp> app, final String[] args) {
final String[] newArgs = this.setupArgs(args, emptyList());
return start(() -> KafkaApplication.startApplicationWithoutExit(app, newArgs));
final Thread thread = new Thread(() -> KafkaApplication.startApplicationWithoutExit(app, newArgs));
thread.start();
}

public int clean(final KafkaStreamsApplication<? extends StreamsApp> app, final String[] args) {
Expand All @@ -67,7 +60,11 @@ public int reset(final KafkaStreamsApplication<? extends StreamsApp> app, final

public Thread run(final KafkaStreamsApplication<? extends StreamsApp> app) {
this.prepareExecution(app);
return start(app);
final Thread thread = new Thread(app);
final UncaughtExceptionHandler handler = new CapturingUncaughtExceptionHandler();
thread.setUncaughtExceptionHandler(handler);
thread.start();
return thread;
}

public void clean(final KafkaStreamsApplication<? extends StreamsApp> app) {
Expand Down

0 comments on commit f16dd10

Please sign in to comment.