Skip to content

Commit

Permalink
Create v3
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Apr 5, 2024
1 parent 3cb59d8 commit e6a1581
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private int execute(final ParseResult parseResult) {
}

private RunningApp<Runner> createRunningApp() {
final ExecutableApp<?, ?, O> app = this.createExecutableApp(false);
final ExecutableApp<R, ?, O> app = this.createExecutableApp(false);
final O executionOptions = this.createExecutionOptions();
final Runner runner = app.createRunner(executionOptions);
return new RunningApp<>(app, runner);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

/**
* An application with a corresponding topic and Kafka configuration
* @param <T> type of {@link Runner}
* @param <C> type of {@link CleanUpRunner}
* @param <O> type of options to create {@link Runner}
* @param <R> type returned by {@link #createRunner()} and {@link #createRunner(Object)}
* @param <C> type returned by {@link #createCleanUpRunner()}
* @param <O> type of options to create runner
*/
public interface ExecutableApp<T extends Runner, C extends CleanUpRunner, O> extends AutoCloseable {
public interface ExecutableApp<R, C, O> extends AutoCloseable {

@Override
void close();
Expand All @@ -39,14 +39,14 @@ public interface ExecutableApp<T extends Runner, C extends CleanUpRunner, O> ext
* Create {@code Runner} in order to run application with default options
* @return {@code Runner}
*/
T createRunner();
R createRunner();

/**
* Create {@code Runner} in order to run application
* @param options options for creating runner
* @return {@code Runner}
*/
T createRunner(O options);
R createRunner(O options);

/**
* Create {@code CleanUpRunner} in order to clean application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import static org.mockito.Mockito.verifyNoMoreInteractions;

import com.bakdata.kafka.CleanUpException;
import com.bakdata.kafka.CleanUpRunner;
import com.bakdata.kafka.ConfiguredStreamsApp;
import com.bakdata.kafka.ExecutableApp;
import com.bakdata.kafka.ExecutableStreamsApp;
Expand Down Expand Up @@ -134,7 +135,7 @@ private static void reset(final ExecutableApp<?, StreamsCleanUpRunner, ?> app) {
app.createCleanUpRunner().reset();
}

private static void clean(final ExecutableApp<?, ?, ?> app) {
private static void clean(final ExecutableApp<?, ? extends CleanUpRunner, ?> app) {
app.createCleanUpRunner().clean();
}

Expand Down

0 comments on commit e6a1581

Please sign in to comment.