You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by rh...@apache.org on 2019/04/23 03:35:20 UTC
[kafka] branch 2.0 updated: MINOR: Correct RestServerTest formatting
This is an automated email from the ASF dual-hosted git repository.
rhauch pushed a commit to branch 2.0
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/2.0 by this push:
new a6a415e MINOR: Correct RestServerTest formatting
a6a415e is described below
commit a6a415edeafe22398efc6eb56bfadab8673ad32c
Author: Randall Hauch <rh...@gmail.com>
AuthorDate: Mon Apr 22 22:34:59 2019 -0500
MINOR: Correct RestServerTest formatting
---
.../kafka/connect/runtime/rest/RestServerTest.java | 44 +++++++++++-----------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/RestServerTest.java b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/RestServerTest.java
index 743f92b..f441ee8 100644
--- a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/RestServerTest.java
+++ b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/rest/RestServerTest.java
@@ -257,27 +257,27 @@ public class RestServerTest {
WorkerConfig workerConfig = new StandaloneConfig(workerProps);
- EasyMock.expect(herder.plugins()).andStubReturn(plugins);
- EasyMock.expect(plugins.newPlugins(Collections.EMPTY_LIST,
- workerConfig,
- ConnectRestExtension.class)).andStubReturn(Collections.EMPTY_LIST);
-
- final Capture<Callback<Collection<String>>> connectorsCallback = EasyMock.newCapture();
- herder.connectors(EasyMock.capture(connectorsCallback));
- PowerMock.expectLastCall().andAnswer(() -> {
- connectorsCallback.getValue().onCompletion(null, Arrays.asList("a", "b"));
- return null;
- });
-
- PowerMock.replayAll();
-
- server = new RestServer(workerConfig);
- server.start(new HerderProvider(herder), herder.plugins());
- HttpRequest request = new HttpGet("/connectors");
- CloseableHttpClient httpClient = HttpClients.createMinimal();
- HttpHost httpHost = new HttpHost(server.advertisedUrl().getHost(), server.advertisedUrl().getPort());
- CloseableHttpResponse response = httpClient.execute(httpHost, request);
-
- Assert.assertEquals(200, response.getStatusLine().getStatusCode());
+ EasyMock.expect(herder.plugins()).andStubReturn(plugins);
+ EasyMock.expect(plugins.newPlugins(Collections.EMPTY_LIST,
+ workerConfig,
+ ConnectRestExtension.class)).andStubReturn(Collections.EMPTY_LIST);
+
+ final Capture<Callback<Collection<String>>> connectorsCallback = EasyMock.newCapture();
+ herder.connectors(EasyMock.capture(connectorsCallback));
+ PowerMock.expectLastCall().andAnswer(() -> {
+ connectorsCallback.getValue().onCompletion(null, Arrays.asList("a", "b"));
+ return null;
+ });
+
+ PowerMock.replayAll();
+
+ server = new RestServer(workerConfig);
+ server.start(new HerderProvider(herder), herder.plugins());
+ HttpRequest request = new HttpGet("/connectors");
+ CloseableHttpClient httpClient = HttpClients.createMinimal();
+ HttpHost httpHost = new HttpHost(server.advertisedUrl().getHost(), server.advertisedUrl().getPort());
+ CloseableHttpResponse response = httpClient.execute(httpHost, request);
+
+ Assert.assertEquals(200, response.getStatusLine().getStatusCode());
}
}