Skip to content

Commit

Permalink
fix: replace assertEquals for assertThat
Browse files Browse the repository at this point in the history
  • Loading branch information
spena committed Oct 10, 2019
1 parent 10ec9d8 commit 72b95c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public final class ServerClusterId {
private static final String KAFKA_CLUSTER = "kafka-cluster";
private static final String KSQL_CLUSTER = "ksql-cluster";

// ID is unused for now, but it might be used later to include a URL that joins both, kafka and
// ksql, clusters names into one single string. This one URL string will be easier to pass
// through authorization commands to authorize access to this KSQL cluster.
private static final String id = "";
private final Map<String, Object> scope;

Expand All @@ -43,6 +46,8 @@ public final class ServerClusterId {

public static ServerClusterId of(final String kafkaClusterId, final String ksqlClusterId) {
return new ServerClusterId(ImmutableMap.of(
// 'path' is unused for now, but it might be used by Cloud environments that specify
// which account organization this cluster belongs to.
"path", Collections.emptyList(),
"clusters", ImmutableMap.of(
KAFKA_CLUSTER, kafkaClusterId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

package io.confluent.ksql.rest.entity;

import static org.junit.Assert.assertEquals;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

import com.google.common.collect.ImmutableMap;

Expand All @@ -34,15 +36,15 @@ public void shouldReturnServerClusterId() {
final Map<String, Object> scope = serverClusterId.getScope();

// Then:
assertEquals("", id);
assertEquals(
ImmutableMap.of(
assertThat(id, is(""));
assertThat(
scope,
equalTo(ImmutableMap.of(
"path", Collections.emptyList(),
"clusters", ImmutableMap.of(
"kafka-cluster", "kafka1",
"ksql-cluster", "ksql1")
),
scope
))
);
}
}

0 comments on commit 72b95c9

Please sign in to comment.