Skip to content

Commit

Permalink
Make methods running before application start public
Browse files Browse the repository at this point in the history
  • Loading branch information
philipp94831 committed Jan 23, 2025
1 parent 6ef31f0 commit a725afb
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.Objects;
import java.util.UUID;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.streams.StreamsConfig;
Expand All @@ -46,6 +47,7 @@
* Class that provides helpers for using Fluent Kafka Streams Tests with {@link ConfiguredStreamsApp}
*/
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public final class TestTopologyFactory {

private static final String MOCK_URL_PREFIX = "mock://";
Expand Down Expand Up @@ -122,15 +124,6 @@ public static Map<String, String> createStreamsTestConfig() {
return STREAMS_TEST_CONFIG;
}

/**
* Get Schema Registry URL if configured
* @return Schema Registry URL
* @throws NullPointerException if Schema Registry is not configured
*/
public String getSchemaRegistryUrl() {
return Objects.requireNonNull(this.schemaRegistryUrl, "Schema Registry is not configured");
}

/**
* Get {@code SchemaRegistryClient} for configured URL with default providers
* @return {@code SchemaRegistryClient}
Expand All @@ -147,8 +140,10 @@ public SchemaRegistryClient getSchemaRegistryClient() {
* @throws NullPointerException if Schema Registry is not configured
*/
public SchemaRegistryClient getSchemaRegistryClient(final List<SchemaProvider> providers) {
return SchemaRegistryClientFactory.newClient(List.of(this.getSchemaRegistryUrl()), 0, providers, emptyMap(),
null);
final List<String> baseUrls = List.of(
Objects.requireNonNull(this.schemaRegistryUrl, "Schema Registry is not configured")
);
return SchemaRegistryClientFactory.newClient(baseUrls, 0, providers, emptyMap(), null);
}

/**
Expand Down

0 comments on commit a725afb

Please sign in to comment.