flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [flink] TisonKun commented on a change in pull request #10205: [FLINK-14797][tests] Remove power mockito from RemoteStreamExecutionEnvironmentTest
Date Fri, 15 Nov 2019 12:50:23 GMT
TisonKun commented on a change in pull request #10205: [FLINK-14797][tests] Remove power mockito
from RemoteStreamExecutionEnvironmentTest
URL: https://github.com/apache/flink/pull/10205#discussion_r346808370
 
 

 ##########
 File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/api/environment/RemoteStreamExecutionEnvironmentTest.java
 ##########
 @@ -20,96 +20,84 @@
 
 import org.apache.flink.api.common.JobExecutionResult;
 import org.apache.flink.api.common.JobID;
-import org.apache.flink.api.common.JobSubmissionResult;
+import org.apache.flink.api.dag.Pipeline;
 import org.apache.flink.client.RemoteExecutor;
-import org.apache.flink.client.program.rest.RestClusterClient;
 import org.apache.flink.configuration.Configuration;
-import org.apache.flink.configuration.RestOptions;
-import org.apache.flink.runtime.clusterframework.ApplicationStatus;
 import org.apache.flink.runtime.jobgraph.SavepointRestoreSettings;
-import org.apache.flink.runtime.jobmaster.JobResult;
 import org.apache.flink.util.TestLogger;
 
-import org.junit.Assert;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.powermock.api.mockito.PowerMockito;
-import org.powermock.core.classloader.annotations.PrepareForTest;
-import org.powermock.modules.junit4.PowerMockRunner;
 
-import java.util.concurrent.CompletableFuture;
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
 
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.when;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
 
 /**
  * Tests for the {@link RemoteStreamEnvironment}.
  */
-@RunWith(PowerMockRunner.class)
-// TODO: I don't like that I have to do this
-@PrepareForTest({RemoteStreamEnvironment.class, RemoteExecutor.class})
 public class RemoteStreamExecutionEnvironmentTest extends TestLogger {
 
 	/**
 	 * Verifies that the port passed to the RemoteStreamEnvironment is used for connecting to
the cluster.
 	 */
 	@Test
 	public void testPortForwarding() throws Exception {
+		final String host = "fakeHost";
 
 Review comment:
   What do you mean by "doesn't test whether we forward the right port anymore"? I think the
code path is config, taking `host` as example, passed as param of RemoteStreamEnvironment
& we check the value when create PlanExecutor. Though, `RemoteStreamEnvironment` has getter
for these config so we can test in other way. In another perspective, we might not test simple
getter. But we does test configure forward.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message