1996fanrui commented on code in PR #22707:
URL: https://github.com/apache/flink/pull/22707#discussion_r1217761023


##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/StreamExecutionEnvironmentTest.java:
##########
@@ -384,70 +364,72 @@ public void testUserDefinedJobNameWithConfigure() {
     private void testJobName(String expectedJobName, 
StreamExecutionEnvironment env) {
         env.fromElements(1, 2, 3).print();
         StreamGraph streamGraph = env.getStreamGraph();
-        assertEquals(expectedJobName, streamGraph.getJobName());
+        assertThat(streamGraph.getJobName()).isEqualTo(expectedJobName);
     }
 
     @Test
-    public void testAddSourceWithUserDefinedTypeInfo() {
+    void testAddSourceWithUserDefinedTypeInfo() {
         StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
         DataStreamSource<Row> source1 =
                 env.addSource(new RowSourceFunction(), 
Types.ROW(Types.STRING));
         // the source type information should be the user defined type
-        assertEquals(Types.ROW(Types.STRING), source1.getType());
+        assertThat(source1.getType()).isEqualTo(Types.ROW(Types.STRING));
 
         DataStreamSource<Row> source2 = env.addSource(new RowSourceFunction());
         // the source type information should be derived from 
RowSourceFunction#getProducedType
-        assertEquals(new GenericTypeInfo<>(Row.class), source2.getType());
+        assertThat(source2.getType()).isEqualTo(new 
GenericTypeInfo<>(Row.class));
     }
 
     @Test
-    public void testBufferTimeoutByDefault() {
+    void testBufferTimeoutByDefault() {
         Configuration config = new Configuration();
         StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
         testBufferTimeout(config, env);
     }
 
     @Test
-    public void testBufferTimeoutEnabled() {
+    void testBufferTimeoutEnabled() {
         Configuration config = new Configuration();
         StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
         config.set(ExecutionOptions.BUFFER_TIMEOUT_ENABLED, true);
         testBufferTimeout(config, env);
     }
 
     @Test
-    public void testBufferTimeoutDisabled() {
+    void testBufferTimeoutDisabled() {
         Configuration config = new Configuration();
         config.set(ExecutionOptions.BUFFER_TIMEOUT_ENABLED, false);
         StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
 
         // The execution.buffer-timeout's default value 100ms will not take 
effect.
         env.configure(config, this.getClass().getClassLoader());
-        assertEquals(ExecutionOptions.DISABLED_NETWORK_BUFFER_TIMEOUT, 
env.getBufferTimeout());
+        assertThat(env.getBufferTimeout())
+                .isEqualTo(ExecutionOptions.DISABLED_NETWORK_BUFFER_TIMEOUT);
 
         // Setting execution.buffer-timeout's to 0ms will not take effect.
-        config.setString(ExecutionOptions.BUFFER_TIMEOUT_INTERVAL.key(), 
"0ms");
+        config.setString(ExecutionOptions.BUFFER_TIMEOUT.key(), "0ms");
         env.configure(config, this.getClass().getClassLoader());
-        assertEquals(ExecutionOptions.DISABLED_NETWORK_BUFFER_TIMEOUT, 
env.getBufferTimeout());
+        assertThat(env.getBufferTimeout())
+                .isEqualTo(ExecutionOptions.DISABLED_NETWORK_BUFFER_TIMEOUT);
 
         // Setting execution.buffer-timeout's to -1ms will not take effect.
-        config.setString(ExecutionOptions.BUFFER_TIMEOUT_INTERVAL.key(), 
"-1ms");
+        config.setString(ExecutionOptions.BUFFER_TIMEOUT.key(), "-1ms");
         env.configure(config, this.getClass().getClassLoader());
-        assertEquals(ExecutionOptions.DISABLED_NETWORK_BUFFER_TIMEOUT, 
env.getBufferTimeout());
+        assertThat(env.getBufferTimeout())
+                .isEqualTo(ExecutionOptions.DISABLED_NETWORK_BUFFER_TIMEOUT);
     }
 
     private void testBufferTimeout(Configuration config, 
StreamExecutionEnvironment env) {
         env.configure(config, this.getClass().getClassLoader());
-        assertEquals(
-                
ExecutionOptions.BUFFER_TIMEOUT_INTERVAL.defaultValue().toMillis(),
-                env.getBufferTimeout());
+        assertThat(env.getBufferTimeout())
+                
.isEqualTo(ExecutionOptions.BUFFER_TIMEOUT.defaultValue().toMillis());
 
-        config.setString(ExecutionOptions.BUFFER_TIMEOUT_INTERVAL.key(), 
"0ms");
+        config.setString(ExecutionOptions.BUFFER_TIMEOUT.key(), "0ms");
         env.configure(config, this.getClass().getClassLoader());
-        assertEquals(0, env.getBufferTimeout());
+        assertThat(env.getBufferTimeout()).isZero();
 
         try {
-            config.setString(ExecutionOptions.BUFFER_TIMEOUT_INTERVAL.key(), 
"-1ms");
+            config.setString(ExecutionOptions.BUFFER_TIMEOUT.key(), "-1ms");
             env.configure(config, this.getClass().getClassLoader());
             fail("exception expected");
         } catch (IllegalArgumentException ignored) {

Review Comment:
   Good catch, updated it and another one.



-- 
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]

Reply via email to