Skip to content

Commit

Permalink
Align after merge from 6.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoeller committed Jun 12, 2024
1 parent 4bb755e commit 8b8604d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.LinkedHashSet;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,32 @@ void nonEmptyParamList() {
}


static ScheduledMethodRunnableAssert assertThatScheduledRunnable(Runnable runnable) {
return new ScheduledMethodRunnableAssert(runnable);
}


static class ScheduledMethodRunnableAssert extends AbstractAssert<ScheduledMethodRunnableAssert, Runnable> {

public ScheduledMethodRunnableAssert(Runnable actual) {
super(actual, ScheduledMethodRunnableAssert.class);
assertThat(actual).extracting("runnable").isInstanceOf(ScheduledMethodRunnable.class);
}

public ScheduledMethodRunnableAssert hasTarget(Object target) {
isNotNull();
assertThat(actual).extracting("runnable.target").isEqualTo(target);
return this;
}

public ScheduledMethodRunnableAssert hasMethodName(String name) {
isNotNull();
assertThat(actual).extracting("runnable.method.name").isEqualTo(name);
return this;
}
}


static class FixedDelay {

@Scheduled(fixedDelay = 5_000)
Expand Down Expand Up @@ -1019,29 +1045,4 @@ public Class<?> convert(Object beanClassName, ParameterContext context) throws A
}
}

static ScheduledMethodRunnableAssert assertThatScheduledRunnable(Runnable runnable) {
return new ScheduledMethodRunnableAssert(runnable);
}

static class ScheduledMethodRunnableAssert extends AbstractAssert<ScheduledMethodRunnableAssert, Runnable> {

public ScheduledMethodRunnableAssert(Runnable actual) {
super(actual, ScheduledMethodRunnableAssert.class);
assertThat(actual).extracting("runnable").isInstanceOf(ScheduledMethodRunnable.class);
}

public ScheduledMethodRunnableAssert hasTarget(Object target) {
isNotNull();
assertThat(actual).extracting("runnable.target").isEqualTo(target);
return this;
}

public ScheduledMethodRunnableAssert hasMethodName(String name) {
isNotNull();
assertThat(actual).extracting("runnable.method.name").isEqualTo(name);
return this;
}

}

}

0 comments on commit 8b8604d

Please sign in to comment.