mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
Fix test helper
This commit is contained in:
@@ -1,10 +1,23 @@
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static sonia.scm.repository.spi.SyncAsyncExecutor.ExecutionType.SYNCHRONOUS;
|
||||
|
||||
public final class SyncAsyncExecutors {
|
||||
|
||||
public static SyncAsyncExecutor synchronousExecutor() {
|
||||
return new SyncAsyncExecutor(Runnable::run, Instant.MAX);
|
||||
return new SyncAsyncExecutor() {
|
||||
@Override
|
||||
public ExecutionType execute(Consumer<ExecutionType> runnable) {
|
||||
runnable.accept(SYNCHRONOUS);
|
||||
return SYNCHRONOUS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasExecutedAllSynchronously() {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user