use of jakarta.json.JsonObject in project zilla by aklivity.
the class SchemaTest method shouldValidateClientHost.
@Test
public void shouldValidateClientHost() {
JsonObject config = schema.validate("client.host.json");
assertThat(config, not(nullValue()));
}
use of jakarta.json.JsonObject in project zilla by aklivity.
the class SchemaTest method shouldValidateServerIPv6.
@Test
public void shouldValidateServerIPv6() {
JsonObject config = schema.validate("server.ipv6.json");
assertThat(config, not(nullValue()));
}
use of jakarta.json.JsonObject in project zilla by aklivity.
the class SchemaTest method shouldValidateClientIPv6.
@Test
public void shouldValidateClientIPv6() {
JsonObject config = schema.validate("client.ipv6.json");
assertThat(config, not(nullValue()));
}
use of jakarta.json.JsonObject in project zilla by aklivity.
the class SseKafkaWithConfigAdapter method adaptFromJson.
@Override
public WithConfig adaptFromJson(JsonObject object) {
String newTopic = object.getString(TOPIC_NAME);
List<SseKafkaWithFilterConfig> newFilters = null;
if (object.containsKey(FILTERS_NAME)) {
JsonArray filters = object.getJsonArray(FILTERS_NAME);
newFilters = new ArrayList<>(filters.size());
for (int i = 0; i < filters.size(); i++) {
JsonObject filter = filters.getJsonObject(i);
String newKey = null;
if (filter.containsKey(KEY_NAME)) {
newKey = filter.getString(KEY_NAME);
}
List<SseKafkaWithFilterHeaderConfig> newHeaders = null;
if (filter.containsKey(HEADERS_NAME)) {
JsonObject headers = filter.getJsonObject(HEADERS_NAME);
newHeaders = new ArrayList<>(headers.size());
for (String newHeaderName : headers.keySet()) {
String newHeaderValue = headers.getString(newHeaderName);
newHeaders.add(new SseKafkaWithFilterHeaderConfig(newHeaderName, newHeaderValue));
}
}
newFilters.add(new SseKafkaWithFilterConfig(newKey, newHeaders));
}
}
return new SseKafkaWithConfig(newTopic, newFilters);
}
use of jakarta.json.JsonObject in project zilla by aklivity.
the class SchemaTest method shouldValidateServerWhenTopicPublishOnly.
@Test
public void shouldValidateServerWhenTopicPublishOnly() {
JsonObject config = schema.validate("server.when.topic.publish.only.json");
assertThat(config, not(nullValue()));
}
Aggregations