Skip to content

Commit

Permalink
[FLINK-28768][tests][testinfrastructure] Update junit to 5.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
snuyanzin authored and zentol committed Oct 12, 2022
1 parent 01d7b37 commit 51fc20d
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public CompletableFuture<Acknowledge> disposeSavepoint(String savepointPath) {
}

@BeforeEach
private void replaceStdOutAndStdErr() {
void replaceStdOutAndStdErr() {
stdOut = System.out;
stdErr = System.err;
buffer = new ByteArrayOutputStream();
Expand All @@ -298,7 +298,7 @@ private void replaceStdOutAndStdErr() {
}

@AfterEach
private void restoreStdOutAndStdErr() {
void restoreStdOutAndStdErr() {
System.setOut(stdOut);
System.setErr(stdErr);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
/** smoke test for the kafka connectors. */
@ExtendWith({TestLoggerExtension.class})
@Testcontainers
public class SmokeKafkaITCase {
class SmokeKafkaITCase {

private static final Logger LOG = LoggerFactory.getLogger(SmokeKafkaITCase.class);
private static final String INTER_CONTAINER_KAFKA_ALIAS = "kafka";
Expand Down Expand Up @@ -107,7 +107,7 @@ private static Configuration getConfiguration() {
}

@BeforeAll
private static void setUp() {
static void setUp() {
final Map<String, Object> adminProperties = new HashMap<>();
adminProperties.put(
CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG,
Expand All @@ -122,7 +122,7 @@ private static void setUp() {
}

@AfterAll
private static void teardown() {
static void teardown() {
admin.close();
producer.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ class DynamicParameterITCase {
private FlinkDistribution dist;

@BeforeEach
private void setup(@TempDir Path tmp) throws IOException {
void setup(@TempDir Path tmp) throws IOException {
TestUtils.copyDirectory(originalDist, tmp);
dist = new FlinkDistribution(tmp);
}

@AfterEach
private void cleanup() throws IOException {
void cleanup() throws IOException {
if (dist != null) {
dist.stopFlinkCluster();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class JarDeleteHandlerTest {
private Path jarDir;

@BeforeEach
private void setUp(@TempDir File tempDir) throws Exception {
void setUp(@TempDir File tempDir) throws Exception {
jarDir = tempDir.toPath();
restfulGateway = new TestingRestfulGateway.Builder().build();
jarDeleteHandler =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static void init(File tmpDir) throws Exception {
}

@BeforeEach
private void reset() {
void reset() {
ParameterProgram.actualArguments = null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
import org.apache.flink.testutils.TestingUtils;
import org.apache.flink.testutils.executor.TestExecutorExtension;
import org.apache.flink.testutils.junit.extensions.ContextClassLoaderExtension;
import org.apache.flink.util.TestLogger;
import org.apache.flink.util.TestLoggerExtension;

import org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpResponseStatus;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.Extension;
import org.junit.jupiter.api.extension.RegisterExtension;

Expand All @@ -54,7 +55,8 @@
import static org.junit.jupiter.api.Assertions.fail;

/** IT cases for {@link RestClient} and {@link RestServerEndpoint}. */
public class RestExternalHandlersITCase extends TestLogger {
@ExtendWith(TestLoggerExtension.class)
class RestExternalHandlersITCase {

private static final Time timeout = Time.seconds(10L);
private static final String REQUEST_URL = "/nonExisting1";
Expand Down Expand Up @@ -102,14 +104,14 @@ private static Configuration getBaseConfig() {
}

@BeforeEach
private void setup() throws Exception {
void setup() throws Exception {
serverEndpoint = TestRestServerEndpoint.builder(config).buildAndStart();
restClient = new RestClient(config, EXECUTOR_RESOURCE.getExecutor());
serverAddress = serverEndpoint.getServerAddress();
}

@AfterEach
private void teardown() throws Exception {
void teardown() throws Exception {
if (restClient != null) {
restClient.shutdown(timeout);
restClient = null;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ under the License.
<javax.activation.api.version>1.2.0</javax.activation.api.version>
<jaxb.api.version>2.3.1</jaxb.api.version>
<junit4.version>4.13.2</junit4.version>
<junit5.version>5.8.1</junit5.version>
<junit5.version>5.9.1</junit5.version>
<archunit.version>0.22.0</archunit.version>
<mockito.version>3.4.6</mockito.version>
<powermock.version>2.0.9</powermock.version>
Expand Down

0 comments on commit 51fc20d

Please sign in to comment.