Search in sources :

Example 31 with JsonObject

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()));
}
Also used : JsonObject(jakarta.json.JsonObject) Test(org.junit.Test)

Example 32 with JsonObject

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()));
}
Also used : JsonObject(jakarta.json.JsonObject) Test(org.junit.Test)

Example 33 with JsonObject

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()));
}
Also used : JsonObject(jakarta.json.JsonObject) Test(org.junit.Test)

Example 34 with JsonObject

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);
}
Also used : JsonArray(jakarta.json.JsonArray) JsonObject(jakarta.json.JsonObject)

Example 35 with JsonObject

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()));
}
Also used : JsonObject(jakarta.json.JsonObject) Test(org.junit.Test)

Aggregations

JsonObject (jakarta.json.JsonObject)356 Test (org.junit.Test)125 Test (org.junit.jupiter.api.Test)92 JsonArray (jakarta.json.JsonArray)29 Response (jakarta.ws.rs.core.Response)29 JsonObjectBuilder (jakarta.json.JsonObjectBuilder)24 JsonString (jakarta.json.JsonString)24 JsonValue (jakarta.json.JsonValue)20 WebClientResponse (io.helidon.webclient.WebClientResponse)19 Client (jakarta.ws.rs.client.Client)18 StringReader (java.io.StringReader)17 HelidonTest (io.helidon.microprofile.tests.junit5.HelidonTest)15 JsonReader (jakarta.json.JsonReader)14 List (java.util.List)14 JsonException (jakarta.json.JsonException)13 Map (java.util.Map)13 Logger (java.util.logging.Logger)13 Routing (io.helidon.webserver.Routing)11 Json (jakarta.json.Json)11 Produces (jakarta.ws.rs.Produces)11