Skip to content

Commit

Permalink
Merge branch '7.5.x' into 7.6.x by rayokota
Browse files Browse the repository at this point in the history
  • Loading branch information
ConfluentSemaphore committed Aug 20, 2024
2 parents 00c7848 + d1cfe23 commit c98a723
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package io.confluent.kafka.schemaregistry.client;

import static io.confluent.kafka.schemaregistry.utils.QualifiedSubject.DEFAULT_CONTEXT;
import static io.confluent.kafka.schemaregistry.utils.QualifiedSubject.DEFAULT_TENANT;

import com.google.common.collect.Lists;
Expand Down Expand Up @@ -717,8 +716,8 @@ public String getMode(String subject) throws IOException, RestClientException {
public Collection<String> getAllContexts() throws IOException, RestClientException {
List<String> results = new ArrayList<>(schemaToIdCache.keySet()).stream()
.map(s -> QualifiedSubject.create(DEFAULT_TENANT, s).getContext())
.filter(s -> !s.isEmpty() && !s.equals(DEFAULT_CONTEXT))
.sorted()
.distinct()
.collect(Collectors.toList());
return results;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,16 @@ public void testGetAllContexts() throws Exception {
id = client.register(":.context1:test-value", avroSchema);
assertEquals(1, id);

id = client.register(":.context1:test-value2", avroSchema);
assertEquals(1, id);

id = client.register("test-value", avroSchema);
id = client.register("test-value", avroSchema);
assertEquals(1, id);

Collection<String> contexts = client.getAllContexts();
Iterator<String> iter = contexts.iterator();
assertEquals(".", iter.next());
assertEquals(".context1", iter.next());
assertEquals(".context2", iter.next());
}
Expand Down

0 comments on commit c98a723

Please sign in to comment.