Skip to content

Commit

Permalink
fix: request / on makeRootRequest instead of /info
Browse files Browse the repository at this point in the history
  • Loading branch information
spena committed Aug 14, 2019
1 parent 878d63e commit 3339c7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion ksql-cli/src/test/java/io/confluent/ksql/cli/CliTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import io.confluent.ksql.rest.server.TestKsqlRestApp;
import io.confluent.ksql.rest.server.computation.CommandId;
import io.confluent.ksql.rest.server.resources.Errors;
import io.confluent.ksql.rest.server.resources.RootDocument;
import io.confluent.ksql.schema.ksql.KsqlSchema;
import io.confluent.ksql.test.util.EmbeddedSingleNodeKafkaCluster;
import io.confluent.ksql.test.util.KsqlIdentifierTestUtil;
Expand Down Expand Up @@ -985,7 +986,7 @@ public void shouldResetStateWhenServerChanges() throws Exception {
givenCommandSequenceNumber(mockRestClient, 5L);
givenRequestPipelining("ON");
when(mockRestClient.makeRootRequest()).thenReturn(
RestResponse.successful(new ServerInfo("version", "clusterId", "serviceId")));
RestResponse.successful(new RootDocument()));

// When:
runCliSpecificCommand("server foo");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import io.confluent.ksql.rest.client.exception.KsqlRestClientException;
import io.confluent.ksql.rest.entity.ServerInfo;
import io.confluent.ksql.rest.server.resources.Errors;
import io.confluent.ksql.rest.server.resources.RootDocument;
import io.confluent.ksql.util.Event;
import java.io.PrintWriter;
import java.io.StringWriter;
Expand All @@ -47,8 +48,7 @@ public class RemoteServerSpecificCommandTest {

private static final String INITIAL_SERVER_ADDRESS = "http://192.168.0.1:8080";
private static final String VALID_SERVER_ADDRESS = "http://localhost:8088";
private static final ServerInfo SERVER_INFO =
new ServerInfo("1.x", "myClusterId", "myKsqlServiceId");
private static final RootDocument ROOT_DOCUMENT = new RootDocument();

@Mock
private KsqlRestClient restClient;
Expand All @@ -65,7 +65,7 @@ public void setUp() throws Exception {
terminal = new PrintWriter(out);
command = RemoteServerSpecificCommand.create(restClient, resetCliForNewServer);

when(restClient.makeRootRequest()).thenReturn(RestResponse.successful(SERVER_INFO));
when(restClient.makeRootRequest()).thenReturn(RestResponse.successful(ROOT_DOCUMENT));
when(restClient.getServerAddress()).thenReturn(new URI(INITIAL_SERVER_ADDRESS));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import io.confluent.ksql.rest.entity.ServerInfo;
import io.confluent.ksql.rest.entity.StreamedRow;
import io.confluent.ksql.rest.server.resources.Errors;
import io.confluent.ksql.rest.server.resources.RootDocument;
import io.confluent.ksql.rest.ssl.DefaultSslClientConfigurer;
import io.confluent.ksql.rest.ssl.SslClientConfigurer;
import io.confluent.rest.validation.JacksonMessageBodyProvider;
Expand Down Expand Up @@ -154,8 +155,8 @@ public void setServerAddress(final String serverAddress) {
this.serverAddresses = parseServerAddresses(serverAddress);
}

public RestResponse<ServerInfo> makeRootRequest() {
return getServerInfo();
public RestResponse<RootDocument> makeRootRequest() {
return getRequest("/", RootDocument.class);
}

public RestResponse<ServerInfo> getServerInfo() {
Expand Down

0 comments on commit 3339c7a

Please sign in to comment.