RocMarshal commented on a change in pull request #18928:
URL: https://github.com/apache/flink/pull/18928#discussion_r828110420
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java
##########
@@ -174,25 +183,17 @@ public void testTriggerSavepointCustomTarget() throws
Exception {
.triggerSavepoint(
eq(jobId), eq(savepointDirectory),
eq(SavepointFormatType.DEFAULT));
- assertTrue(buffer.toString().contains(savepointDirectory));
+ assertThat(buffer.toString()).contains(savepointDirectory);
} finally {
clusterClient.close();
restoreStdOutAndStdErr();
}
}
- @Test
- public void testTriggerSavepointCustomFormatShortOption() throws Exception
{
- testTriggerSavepointCustomFormat("-t", SavepointFormatType.NATIVE);
- }
-
- @Test
- public void testTriggerSavepointCustomFormatLongOption() throws Exception {
- testTriggerSavepointCustomFormat("--type", SavepointFormatType.NATIVE);
- }
-
- private void testTriggerSavepointCustomFormat(String flag,
SavepointFormatType formatType)
+ @MethodSource("testArguments")
Review comment:
Precise & Concise
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/deployment/ClusterClientServiceLoaderTest.java
##########
@@ -22,19 +22,14 @@
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.DeploymentOptions;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import javax.annotation.Nullable;
-import static org.hamcrest.CoreMatchers.allOf;
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.core.Is.is;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.jupiter.api.Assertions.fail;
/** Tests for the {@link DefaultClusterClientServiceLoader}. */
public class ClusterClientServiceLoaderTest {
Review comment:
This class is referenced by other resource. And it will fail without
`public`.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendInfoTest.java
##########
@@ -20,42 +20,53 @@
import org.apache.flink.configuration.Configuration;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.Collections;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.jupiter.api.Assertions.fail;
/** Tests for the "info" command. */
-public class CliFrontendInfoTest extends CliFrontendTestBase {
+class CliFrontendInfoTest extends CliFrontendTestBase {
private static PrintStream stdOut;
private static PrintStream capture;
private static ByteArrayOutputStream buffer;
- @Test(expected = CliArgsException.class)
- public void testMissingOption() throws Exception {
- String[] parameters = {};
- Configuration configuration = getConfiguration();
- CliFrontend testFrontend =
- new CliFrontend(configuration,
Collections.singletonList(getCli()));
- testFrontend.cancel(parameters);
+ @Test
+ void testMissingOption() throws Exception {
+ assertThatThrownBy(
+ () -> {
+ String[] parameters = {};
+ Configuration configuration = getConfiguration();
+ CliFrontend testFrontend =
+ new CliFrontend(
+ configuration,
Collections.singletonList(getCli()));
+ testFrontend.cancel(parameters);
Review comment:
OK. I'll check it.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/deployment/ClusterClientServiceLoaderTest.java
##########
@@ -59,7 +54,7 @@ public void testStandaloneClusterClientFactoryDiscovery() {
ClusterClientFactory<StandaloneClusterId> factory =
serviceLoaderUnderTest.getClusterClientFactory(config);
- assertTrue(factory instanceof StandaloneClientFactory);
+ assertThat(factory instanceof StandaloneClientFactory).isTrue();
Review comment:
Good catch.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendSavepointTest.java
##########
@@ -271,26 +272,26 @@ public void testDisposeWithJar() throws Exception {
CliFrontend frontend = new MockedCliFrontend(clusterClient);
// Fake JAR file
- File f = tmp.newFile();
+ File f = newFileIn(tmp, "test.jar").toFile();
Review comment:
smart comment.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/deployment/application/JarManifestParserTest.java
##########
@@ -72,25 +71,25 @@ public void testFindEntryClassAssemblerClass() throws
IOException {
Optional<String> entry = JarManifestParser.findEntryClass(jarFile);
- assertTrue(entry.isPresent());
- assertThat(entry.get(), is(equalTo("AssemblerClass")));
+ assertThat(entry.isPresent()).isTrue();
+ assertThat(entry.get()).isEqualTo("AssemblerClass");
Review comment:
Good introduction.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendStopWithSavepointTest.java
##########
@@ -28,34 +28,42 @@
import org.apache.flink.util.FlinkException;
import org.apache.flink.util.concurrent.FutureUtils;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
import java.util.Collections;
import java.util.concurrent.CompletableFuture;
+import java.util.stream.Stream;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.jupiter.api.Assertions.fail;
/** Tests for the STOP command. */
-public class CliFrontendStopWithSavepointTest extends CliFrontendTestBase {
+class CliFrontendStopWithSavepointTest extends CliFrontendTestBase {
- @BeforeClass
- public static void setup() {
+ @BeforeAll
+ static void setup() {
CliFrontendTestUtils.pipeSystemOutToNull();
}
- @AfterClass
- public static void shutdown() {
+ @AfterAll
+ static void shutdown() {
CliFrontendTestUtils.restoreSystemOut();
}
+ private static Stream<Arguments> testArguments() {
Review comment:
Get.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/program/ClientTest.java
##########
@@ -326,7 +333,7 @@ public Void answer(InvocationOnMock invocation) throws
Throwable {
}
Review comment:
precise
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/program/ClientTest.java
##########
@@ -377,7 +384,7 @@ public void testFailOnForbiddenConfiguration() throws
ProgramInvocationException
false))
.satisfies(
Review comment:
Nice idea.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendDynamicPropertiesTest.java
##########
@@ -25,50 +25,49 @@
import org.apache.flink.util.ChildFirstClassLoader;
import org.apache.commons.cli.Options;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
import java.util.Collections;
import static
org.apache.flink.client.cli.CliFrontendTestUtils.TEST_JAR_MAIN_CLASS;
import static org.apache.flink.client.cli.CliFrontendTestUtils.getTestJarPath;
-import static org.junit.Assert.assertEquals;
+import static org.assertj.core.api.Assertions.assertThat;
/** Tests for the RUN command with Dynamic Properties. */
-public class CliFrontendDynamicPropertiesTest extends CliFrontendTestBase {
+class CliFrontendDynamicPropertiesTest extends CliFrontendTestBase {
private GenericCLI cliUnderTest;
private Configuration configuration;
- @Rule public TemporaryFolder tmp = new TemporaryFolder();
+ @TempDir private java.nio.file.Path tmp;
Review comment:
Good idea~
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/deployment/application/FromClasspathEntryClassInformationProviderTest.java
##########
@@ -18,161 +18,195 @@
package org.apache.flink.client.deployment.application;
-import org.apache.flink.client.testjar.ClasspathProvider;
+import org.apache.flink.client.testjar.ClasspathProviderExtension;
import org.apache.flink.util.FlinkException;
-import org.apache.flink.util.TestLogger;
+import org.apache.flink.util.TestLoggerExtension;
import org.apache.commons.io.FilenameUtils;
-import org.hamcrest.CoreMatchers;
-import org.hamcrest.collection.IsIterableContainingInAnyOrder;
-import org.hamcrest.core.IsCollectionContaining;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.extension.RegisterExtension;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
+import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* {@code FromClasspathEntryClassInformationProviderTest} tests {@link
* FromClasspathEntryClassInformationProvider}.
*/
-public class FromClasspathEntryClassInformationProviderTest extends TestLogger
{
+@ExtendWith(TestLoggerExtension.class)
+class FromClasspathEntryClassInformationProviderTest {
- @Rule
- public ClasspathProvider noEntryClassClasspathProvider =
- ClasspathProvider.createWithNoEntryClass();
+ @RegisterExtension
+ ClasspathProviderExtension noEntryClassClasspathProvider =
+ ClasspathProviderExtension.createWithNoEntryClass();
- @Rule
- public ClasspathProvider singleEntryClassClasspathProvider =
- ClasspathProvider.createWithSingleEntryClass();
+ @RegisterExtension
+ ClasspathProviderExtension singleEntryClassClasspathProvider =
+ ClasspathProviderExtension.createWithSingleEntryClass();
- @Rule
- public ClasspathProvider multipleEntryClassesClasspathProvider =
- ClasspathProvider.createWithMultipleEntryClasses();
+ @RegisterExtension
+ ClasspathProviderExtension multipleEntryClassesClasspathProvider =
+ ClasspathProviderExtension.createWithMultipleEntryClasses();
- @Rule
- public ClasspathProvider testJobEntryClassClasspathProvider =
- ClasspathProvider.createWithTestJobOnly();
+ @RegisterExtension
+ ClasspathProviderExtension testJobEntryClassClasspathProvider =
+ ClasspathProviderExtension.createWithTestJobOnly();
- @Rule
- public ClasspathProvider onlyTextFileClasspathProvider =
- ClasspathProvider.createWithTextFileOnly();
+ @RegisterExtension
+ ClasspathProviderExtension onlyTextFileClasspathProvider =
+ ClasspathProviderExtension.createWithTextFileOnly();
@Test
- public void testJobClassOnUserClasspathWithExplicitJobClassName()
- throws IOException, FlinkException {
+ void testJobClassOnUserClasspathWithExplicitJobClassName() throws
IOException, FlinkException {
FromClasspathEntryClassInformationProvider testInstance =
FromClasspathEntryClassInformationProvider.create(
singleEntryClassClasspathProvider.getJobClassName(),
singleEntryClassClasspathProvider.getURLUserClasspath());
- assertThat(testInstance.getJobClassName().isPresent(), is(true));
- assertThat(
- testInstance.getJobClassName().get(),
- is(singleEntryClassClasspathProvider.getJobClassName()));
- assertThat(testInstance.getJarFile().isPresent(), is(false));
+ assertThat(testInstance.getJobClassName().isPresent()).isTrue();
+ assertThat(testInstance.getJobClassName().get())
+
.isEqualTo(singleEntryClassClasspathProvider.getJobClassName());
+ assertThat(testInstance.getJarFile().isPresent()).isFalse();
}
- @Test(expected = FlinkException.class)
- public void testJobClassOnUserClasspathWithOnlyTestFileOnClasspath()
+ @Test
+ void testJobClassOnUserClasspathWithOnlyTestFileOnClasspath()
throws IOException, FlinkException {
- // we want to check that the right exception is thrown if the user
classpath is empty
- FromClasspathEntryClassInformationProvider.create(
- "SomeJobClassName",
onlyTextFileClasspathProvider.getURLUserClasspath());
+ assertThatThrownBy(
+ () -> {
+ // we want to check that the right exception is
thrown if the user
+ // classpath is empty
+ FromClasspathEntryClassInformationProvider.create(
+ "SomeJobClassName",
+
onlyTextFileClasspathProvider.getURLUserClasspath());
+ })
+ .isInstanceOf(FlinkException.class);
}
- @Test(expected = NullPointerException.class)
- public void testJobClassOnUserClasspathWithMissingJobClassName()
- throws IOException, FlinkException {
- FromClasspathEntryClassInformationProvider.create(
- null, singleEntryClassClasspathProvider.getURLUserClasspath());
+ @Test
+ void testJobClassOnUserClasspathWithMissingJobClassName() throws
IOException, FlinkException {
+ assertThatThrownBy(
+ () -> {
+ FromClasspathEntryClassInformationProvider.create(
+ null,
singleEntryClassClasspathProvider.getURLUserClasspath());
+ })
+ .isInstanceOf(NullPointerException.class);
}
- @Test(expected = NullPointerException.class)
- public void testJobClassOnUserClasspathWithMissingUserClasspath()
- throws IOException, FlinkException {
- FromClasspathEntryClassInformationProvider.create("jobClassName",
null);
+ @Test
+ void testJobClassOnUserClasspathWithMissingUserClasspath() throws
IOException, FlinkException {
+ assertThatThrownBy(
+ () -> {
+
FromClasspathEntryClassInformationProvider.create("jobClassName", null);
+ })
+ .isInstanceOf(NullPointerException.class);
}
@Test
- public void testJobClassOnUserClasspathWithoutExplicitJobClassName()
+ void testJobClassOnUserClasspathWithoutExplicitJobClassName()
throws IOException, FlinkException {
FromClasspathEntryClassInformationProvider testInstance =
FromClasspathEntryClassInformationProvider.createFromClasspath(
singleEntryClassClasspathProvider.getURLUserClasspath());
- assertThat(testInstance.getJobClassName().isPresent(), is(true));
- assertThat(
- testInstance.getJobClassName().get(),
- is(singleEntryClassClasspathProvider.getJobClassName()));
- assertThat(testInstance.getJarFile().isPresent(), is(false));
+ assertThat(testInstance.getJobClassName().isPresent()).isTrue();
+ assertThat(testInstance.getJobClassName().get())
+
.isEqualTo(singleEntryClassClasspathProvider.getJobClassName());
+ assertThat(testInstance.getJarFile().isPresent()).isFalse();
}
- @Test(expected = FlinkException.class)
- public void testMissingJobClassOnUserClasspathWithoutExplicitJobClassName()
+ @Test
+ void testMissingJobClassOnUserClasspathWithoutExplicitJobClassName()
throws IOException, FlinkException {
- FromClasspathEntryClassInformationProvider.createFromClasspath(
- noEntryClassClasspathProvider.getURLUserClasspath());
+ assertThatThrownBy(
+ () -> {
+
FromClasspathEntryClassInformationProvider.createFromClasspath(
+
noEntryClassClasspathProvider.getURLUserClasspath());
+ })
+ .isInstanceOf(FlinkException.class);
}
- @Test(expected = FlinkException.class)
- public void testTooManyMainMethodsOnUserClasspath() throws IOException,
FlinkException {
- FromClasspathEntryClassInformationProvider.createFromClasspath(
- multipleEntryClassesClasspathProvider.getURLUserClasspath());
+ @Test
+ void testTooManyMainMethodsOnUserClasspath() throws IOException,
FlinkException {
+ assertThatThrownBy(
+ () -> {
+
FromClasspathEntryClassInformationProvider.createFromClasspath(
+
multipleEntryClassesClasspathProvider.getURLUserClasspath());
+ })
+ .isInstanceOf(FlinkException.class);
}
- @Test(expected = NullPointerException.class)
- public void
testJobClassOnUserClasspathWithoutExplicitJobClassNameAndMissingUserClasspath()
+ @Test
+ void
testJobClassOnUserClasspathWithoutExplicitJobClassNameAndMissingUserClasspath()
throws IOException, FlinkException {
- FromClasspathEntryClassInformationProvider.createFromClasspath(null);
+ assertThatThrownBy(
+ () -> {
+
FromClasspathEntryClassInformationProvider.createFromClasspath(null);
+ })
+ .isInstanceOf(NullPointerException.class);
}
@Test
- public void testJobClassNameFromSystemClasspath() throws IOException,
FlinkException {
+ void testJobClassNameFromSystemClasspath() throws IOException,
FlinkException {
singleEntryClassClasspathProvider.setSystemClasspath();
FromClasspathEntryClassInformationProvider testInstance =
FromClasspathEntryClassInformationProvider.createFromSystemClasspath();
- assertThat(testInstance.getJobClassName().isPresent(), is(true));
- assertThat(
- testInstance.getJobClassName().get(),
- is(singleEntryClassClasspathProvider.getJobClassName()));
- assertThat(testInstance.getJarFile().isPresent(), is(false));
+ assertThat(testInstance.getJobClassName().isPresent()).isTrue();
+ assertThat(testInstance.getJobClassName().get())
+
.isEqualTo(singleEntryClassClasspathProvider.getJobClassName());
+ assertThat(testInstance.getJarFile().isPresent()).isFalse();
}
- @Test(expected = FlinkException.class)
- public void testMissingJobClassNameFromSystemClasspath() throws
IOException, FlinkException {
- noEntryClassClasspathProvider.setSystemClasspath();
- FromClasspathEntryClassInformationProvider.createFromSystemClasspath();
+ @Test
+ void testMissingJobClassNameFromSystemClasspath() throws IOException,
FlinkException {
+ assertThatThrownBy(
+ () -> {
+ noEntryClassClasspathProvider.setSystemClasspath();
+
FromClasspathEntryClassInformationProvider.createFromSystemClasspath();
+ })
+ .isInstanceOf(FlinkException.class);
}
- @Test(expected = FlinkException.class)
- public void testTooManyMainMethodsOnSystemClasspath() throws IOException,
FlinkException {
- multipleEntryClassesClasspathProvider.setSystemClasspath();
- FromClasspathEntryClassInformationProvider.createFromSystemClasspath();
+ @Test
+ void testTooManyMainMethodsOnSystemClasspath() throws IOException,
FlinkException {
+ assertThatThrownBy(
+ () -> {
+
multipleEntryClassesClasspathProvider.setSystemClasspath();
+
FromClasspathEntryClassInformationProvider.createFromSystemClasspath();
+ })
+ .isInstanceOf(FlinkException.class);
}
@Test
- public void testJarFromSystemClasspathSanityCheck() {
+ void testJarFromSystemClasspathSanityCheck() {
// Junit executes this test, so it should be returned as part of JARs
on the classpath
final Iterable<File> systemClasspath =
FromClasspathEntryClassInformationProvider.extractSystemClasspath();
assertThat(
- StreamSupport.stream(systemClasspath.spliterator(), false)
- .map(File::getName)
- .collect(Collectors.toList()),
-
IsCollectionContaining.hasItem(CoreMatchers.containsString("junit")));
+ StreamSupport.stream(systemClasspath.spliterator(),
false)
+ .map(File::getName)
+ .collect(Collectors.toList()))
Review comment:
Good idea.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/deployment/application/FromClasspathEntryClassInformationProviderTest.java
##########
@@ -18,161 +18,195 @@
package org.apache.flink.client.deployment.application;
-import org.apache.flink.client.testjar.ClasspathProvider;
+import org.apache.flink.client.testjar.ClasspathProviderExtension;
import org.apache.flink.util.FlinkException;
-import org.apache.flink.util.TestLogger;
+import org.apache.flink.util.TestLoggerExtension;
import org.apache.commons.io.FilenameUtils;
-import org.hamcrest.CoreMatchers;
-import org.hamcrest.collection.IsIterableContainingInAnyOrder;
-import org.hamcrest.core.IsCollectionContaining;
-import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.junit.jupiter.api.extension.RegisterExtension;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
+import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.core.Is.is;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* {@code FromClasspathEntryClassInformationProviderTest} tests {@link
* FromClasspathEntryClassInformationProvider}.
*/
-public class FromClasspathEntryClassInformationProviderTest extends TestLogger
{
+@ExtendWith(TestLoggerExtension.class)
+class FromClasspathEntryClassInformationProviderTest {
- @Rule
- public ClasspathProvider noEntryClassClasspathProvider =
- ClasspathProvider.createWithNoEntryClass();
+ @RegisterExtension
+ ClasspathProviderExtension noEntryClassClasspathProvider =
+ ClasspathProviderExtension.createWithNoEntryClass();
- @Rule
- public ClasspathProvider singleEntryClassClasspathProvider =
- ClasspathProvider.createWithSingleEntryClass();
+ @RegisterExtension
+ ClasspathProviderExtension singleEntryClassClasspathProvider =
+ ClasspathProviderExtension.createWithSingleEntryClass();
- @Rule
- public ClasspathProvider multipleEntryClassesClasspathProvider =
- ClasspathProvider.createWithMultipleEntryClasses();
+ @RegisterExtension
+ ClasspathProviderExtension multipleEntryClassesClasspathProvider =
+ ClasspathProviderExtension.createWithMultipleEntryClasses();
- @Rule
- public ClasspathProvider testJobEntryClassClasspathProvider =
- ClasspathProvider.createWithTestJobOnly();
+ @RegisterExtension
+ ClasspathProviderExtension testJobEntryClassClasspathProvider =
+ ClasspathProviderExtension.createWithTestJobOnly();
- @Rule
- public ClasspathProvider onlyTextFileClasspathProvider =
- ClasspathProvider.createWithTextFileOnly();
+ @RegisterExtension
+ ClasspathProviderExtension onlyTextFileClasspathProvider =
+ ClasspathProviderExtension.createWithTextFileOnly();
@Test
- public void testJobClassOnUserClasspathWithExplicitJobClassName()
- throws IOException, FlinkException {
+ void testJobClassOnUserClasspathWithExplicitJobClassName() throws
IOException, FlinkException {
FromClasspathEntryClassInformationProvider testInstance =
FromClasspathEntryClassInformationProvider.create(
singleEntryClassClasspathProvider.getJobClassName(),
singleEntryClassClasspathProvider.getURLUserClasspath());
- assertThat(testInstance.getJobClassName().isPresent(), is(true));
- assertThat(
- testInstance.getJobClassName().get(),
- is(singleEntryClassClasspathProvider.getJobClassName()));
- assertThat(testInstance.getJarFile().isPresent(), is(false));
+ assertThat(testInstance.getJobClassName().isPresent()).isTrue();
+ assertThat(testInstance.getJobClassName().get())
+
.isEqualTo(singleEntryClassClasspathProvider.getJobClassName());
+ assertThat(testInstance.getJarFile().isPresent()).isFalse();
}
- @Test(expected = FlinkException.class)
- public void testJobClassOnUserClasspathWithOnlyTestFileOnClasspath()
+ @Test
+ void testJobClassOnUserClasspathWithOnlyTestFileOnClasspath()
throws IOException, FlinkException {
Review comment:
Glad to check it.
##########
File path:
flink-clients/src/test/java/org/apache/flink/client/cli/CliFrontendInfoTest.java
##########
@@ -84,7 +95,7 @@ public void testShowExecutionPlanWithParallelism() {
CliFrontend testFrontend =
new CliFrontend(configuration,
Collections.singletonList(getCli()));
testFrontend.info(parameters);
- assertTrue(buffer.toString().contains("\"parallelism\" : 17"));
+ assertThat(buffer.toString().contains("\"parallelism\" :
17")).isTrue();
Review comment:
Good catch.
--
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]