Skip to content

Commit

Permalink
Try to fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffxiang committed Aug 29, 2024
1 parent 7b83ee8 commit 201a417
Showing 1 changed file with 3 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,14 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TestPscMetadataClient {

protected static final String testKafkaTopic1 = "plaintext:" + TopicUri.SEPARATOR + TopicUri.STANDARD + ":kafka:env:aws_us-west-1::kafkacluster01:topic1";

@Test
void testGetBackendMetadataClient() throws Exception {
String fallbackDiscoveryFilename = DiscoveryUtil.createTempFallbackFile();
PscConfiguration pscConfiguration = new PscConfiguration();
pscConfiguration.addProperty(PscConfiguration.PSC_DISCOVERY_FALLBACK_FILE, fallbackDiscoveryFilename);
pscConfiguration.addProperty(PscConfiguration.PSC_METADATA_CLIENT_ID, "test-metadata-client");

PscMetadataClient pscMetadataClient = new PscMetadataClient(pscConfiguration);
PscBackendMetadataClient backendMetadataClient = pscMetadataClient.getBackendMetadataClient(TopicUri.validate(testKafkaTopic1));
assertEquals(PscKafkaMetadataClient.class, backendMetadataClient.getClass());
assertEquals("kafkacluster01001:9092,kafkacluster01002:9092", backendMetadataClient.getDiscoveryConfig().getConnect());
pscMetadataClient.close();
}

@Test
void testCreateTopicRn() throws TopicUriSyntaxException {
TopicRn topic1Rn = TopicUri.validate(testKafkaTopic1).getTopicRn();
Expand Down

0 comments on commit 201a417

Please sign in to comment.