Search in sources :

Example 61 with JsonObject

use of jakarta.json.JsonObject in project zilla by aklivity.

the class SchemaTest method shouldValidateClientWhen.

@Test
public void shouldValidateClientWhen() {
    JsonObject config = schema.validate("client.when.json");
    assertThat(config, not(nullValue()));
}
Also used : JsonObject(jakarta.json.JsonObject) Test(org.junit.Test)

Example 62 with JsonObject

use of jakarta.json.JsonObject in project zilla by aklivity.

the class SchemaTest method shouldValidateClient.

@Test
public void shouldValidateClient() {
    JsonObject config = schema.validate("client.json");
    assertThat(config, not(nullValue()));
}
Also used : JsonObject(jakarta.json.JsonObject) Test(org.junit.Test)

Example 63 with JsonObject

use of jakarta.json.JsonObject in project zilla by aklivity.

the class SchemaTest method shouldValidateServer.

@Test
public void shouldValidateServer() {
    JsonObject config = schema.validate("server.json");
    assertThat(config, not(nullValue()));
}
Also used : JsonObject(jakarta.json.JsonObject) Test(org.junit.Test)

Example 64 with JsonObject

use of jakarta.json.JsonObject in project zilla by aklivity.

the class SchemaTest method shouldValidateVault.

@Test
public void shouldValidateVault() {
    JsonObject config = schema.validate("vault.json");
    assertThat(config, not(nullValue()));
}
Also used : JsonObject(jakarta.json.JsonObject) Test(org.junit.Test)

Example 65 with JsonObject

use of jakarta.json.JsonObject in project alias by JohT.

the class TypeReferenceEnhancer method adaptFromJson.

/**
 * {@inheritDoc}
 */
@Override
@SuppressWarnings("unchecked")
public T adaptFromJson(JsonObject obj) throws Exception {
    JsonObject original = Json.createObjectBuilder(obj).remove(FIELD_TYPE_REFERENCE).build();
    Class<?> type = typeReferenceResolver.getTypeForReference(obj.getString(FIELD_TYPE_REFERENCE));
    return (T) getJsonb().fromJson(original.toString(), type);
}
Also used : JsonObject(jakarta.json.JsonObject)

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