1996fanrui commented on code in PR #23203:
URL: https://github.com/apache/flink/pull/23203#discussion_r1294785979
##########
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/adaptive/StateTest.java:
##########
@@ -18,85 +18,71 @@
package org.apache.flink.runtime.scheduler.adaptive;
-import org.apache.flink.util.TestLogger;
-
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.fail;
/**
* Tests for the default methods on the {@link State} interface, based on the
{@link Created} state,
* as it is a simple state.
*/
-public class StateTest extends TestLogger {
+class StateTest {
+
+ private static final Logger LOG = LoggerFactory.getLogger(StateTest.class);
+
+ @RegisterExtension CreatedTest.MockCreatedContext ctx = new
CreatedTest.MockCreatedContext();
Review Comment:
Move the `AfterEachCallback` refactoring into the second commit is more
reasonable.
I just want to check with you could we keep the refactoring in the third
commit? The code is to hard to extract them from the third commit due to some
reasons:
- The third commit removed a lot of method from `CretedTest`,
`CreatingExecutionGraphTest` and `WaitingForResourcesTest`.
- If I want to finish the `AfterEachCallback` refactoring in the second
commit, I must address removed methods as well. And let these Context
implements `AfterEachCallback` in the second commit, updated the
`AfterEachCallback` to `MockStateWithoutExecutionGraphContext` in the third
commit.
It can do, but it needs some time to prevent mistake. After this PR, the
code is clean, so leaving as it is is fine for the master branch, right?
Please let me know if there are some reasons. If it is necessary to migrate
these codes to a second commit, I can do that too, thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]