Skip to content

Commit

Permalink
fix: use JacksonTypeManager instead (#326)
Browse files Browse the repository at this point in the history
* fix: use JacksonTypeManager instead

* DEPENDENCIES

* fix test
  • Loading branch information
paullatzelsperger authored Apr 15, 2024
1 parent 26ca82d commit e00504e
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 19 deletions.
7 changes: 4 additions & 3 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ maven/mavencentral/org.apiguardian/apiguardian-api/1.1.2, Apache-2.0, approved,
maven/mavencentral/org.assertj/assertj-core/3.25.3, Apache-2.0, approved, #12585
maven/mavencentral/org.awaitility/awaitility/4.2.1, Apache-2.0, approved, #14178
maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.72, MIT, approved, #3789
maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.77, MIT, approved, #11593
maven/mavencentral/org.bouncycastle/bcpkix-jdk18on/1.78, MIT, approved, #14235
maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.72, MIT AND CC0-1.0, approved, #3538
maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.77, MIT AND CC0-1.0, approved, #11595
maven/mavencentral/org.bouncycastle/bcprov-jdk18on/1.78, MIT AND CC0-1.0, approved, #14237
maven/mavencentral/org.bouncycastle/bcutil-jdk18on/1.72, MIT, approved, #3790
maven/mavencentral/org.bouncycastle/bcutil-jdk18on/1.77, MIT, approved, #11596
maven/mavencentral/org.bouncycastle/bcutil-jdk18on/1.78, MIT, approved, #14238
maven/mavencentral/org.ccil.cowan.tagsoup/tagsoup/1.2.1, Apache-2.0, approved, clearlydefined
maven/mavencentral/org.checkerframework/checker-qual/3.12.0, MIT, approved, clearlydefined
maven/mavencentral/org.checkerframework/checker-qual/3.42.0, MIT, approved, clearlydefined
Expand Down Expand Up @@ -262,6 +262,7 @@ maven/mavencentral/org.eclipse.edc/jetty-core/0.6.1-SNAPSHOT, Apache-2.0, approv
maven/mavencentral/org.eclipse.edc/json-ld-lib/0.6.1-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/json-ld-spi/0.6.1-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/json-ld/0.6.1-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/json-lib/0.6.1-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/junit-base/0.6.1-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/junit/0.6.1-SNAPSHOT, Apache-2.0, approved, technology.edc
maven/mavencentral/org.eclipse.edc/jws2020-lib/0.6.1-SNAPSHOT, Apache-2.0, approved, technology.edc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.eclipse.edc.identityhub.api;

import org.eclipse.edc.iam.identitytrust.spi.model.PresentationQueryMessage;
import org.eclipse.edc.iam.identitytrust.transform.from.JsonObjectFromPresentationResponseMessageTransformer;
import org.eclipse.edc.iam.identitytrust.transform.to.JsonObjectToPresentationQueryTransformer;
import org.eclipse.edc.identityhub.api.v1.PresentationApiController;
import org.eclipse.edc.identityhub.api.validation.PresentationQueryValidator;
Expand Down Expand Up @@ -87,6 +88,7 @@ public void initialize(ServiceExtensionContext context) {
// register transformer -- remove once registration is handled in EDC
typeTransformer.register(new JsonObjectToPresentationQueryTransformer(jsonLdMapper));
typeTransformer.register(new JsonValueToGenericTypeTransformer(jsonLdMapper));
typeTransformer.register(new JsonObjectFromPresentationResponseMessageTransformer());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.eclipse.edc.identityhub.spi.store.CredentialStore;
import org.eclipse.edc.identityhub.store.sql.credentials.schema.postgres.PostgresDialectStatements;
import org.eclipse.edc.identityhub.store.test.CredentialStoreTestBase;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.junit.annotations.ComponentTest;
import org.eclipse.edc.spi.types.TypeManager;
import org.eclipse.edc.sql.QueryExecutor;
import org.eclipse.edc.sql.testfixtures.PostgresqlStoreSetupExtension;
import org.junit.jupiter.api.AfterEach;
Expand All @@ -38,7 +38,7 @@ class SqlCredentialsStoreTest extends CredentialStoreTestBase {

@BeforeEach
void setup(PostgresqlStoreSetupExtension extension, QueryExecutor queryExecutor) throws IOException {
var typeManager = new TypeManager();
var typeManager = new JacksonTypeManager();
store = new SqlCredentialStore(extension.getDataSourceRegistry(), extension.getDatasourceName(),
extension.getTransactionContext(), typeManager.getMapper(), queryExecutor, statements);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.eclipse.edc.identithub.did.spi.store.DidResourceStore;
import org.eclipse.edc.identityhub.did.store.sql.schema.postgres.PostgresDialectStatements;
import org.eclipse.edc.identityhub.did.store.test.DidResourceStoreTestBase;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.junit.annotations.ComponentTest;
import org.eclipse.edc.spi.types.TypeManager;
import org.eclipse.edc.sql.QueryExecutor;
import org.eclipse.edc.sql.testfixtures.PostgresqlStoreSetupExtension;
import org.junit.jupiter.api.AfterEach;
Expand All @@ -38,7 +38,7 @@ class SqlDidResourceStoreTest extends DidResourceStoreTestBase {

@BeforeEach
void setup(PostgresqlStoreSetupExtension extension, QueryExecutor queryExecutor) throws IOException {
var typeManager = new TypeManager();
var typeManager = new JacksonTypeManager();
store = new SqlDidResourceStore(extension.getDataSourceRegistry(), extension.getDatasourceName(),
extension.getTransactionContext(), typeManager.getMapper(), queryExecutor, statements);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import org.eclipse.edc.identityhub.spi.store.KeyPairResourceStore;
import org.eclipse.edc.identityhub.store.sql.keypair.schema.postgres.PostgresDialectStatements;
import org.eclipse.edc.identityhub.store.test.KeyPairResourceStoreTestBase;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.junit.annotations.ComponentTest;
import org.eclipse.edc.spi.types.TypeManager;
import org.eclipse.edc.sql.QueryExecutor;
import org.eclipse.edc.sql.testfixtures.PostgresqlStoreSetupExtension;
import org.junit.jupiter.api.AfterEach;
Expand All @@ -37,7 +37,7 @@ class SqlKeyPairResourceStoreTest extends KeyPairResourceStoreTestBase {

@BeforeEach
void setup(PostgresqlStoreSetupExtension extension, QueryExecutor queryExecutor) throws IOException {
var typeManager = new TypeManager();
var typeManager = new JacksonTypeManager();
store = new SqlKeyPairResourceStore(extension.getDataSourceRegistry(), extension.getDatasourceName(),
extension.getTransactionContext(), typeManager.getMapper(), queryExecutor, statements);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import org.eclipse.edc.identityhub.store.sql.participantcontext.SqlParticipantContextStore;
import org.eclipse.edc.identityhub.store.sql.participantcontext.schema.postgres.PostgresDialectStatements;
import org.eclipse.edc.identityhub.store.test.ParticipantContextStoreTestBase;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.junit.annotations.ComponentTest;
import org.eclipse.edc.spi.types.TypeManager;
import org.eclipse.edc.sql.QueryExecutor;
import org.eclipse.edc.sql.testfixtures.PostgresqlStoreSetupExtension;
import org.junit.jupiter.api.AfterEach;
Expand All @@ -40,7 +40,7 @@ class SqlParticipantContextStoreTest extends ParticipantContextStoreTestBase {

@BeforeEach
void setup(PostgresqlStoreSetupExtension extension, QueryExecutor queryExecutor) throws IOException {
var typeManager = new TypeManager();
var typeManager = new JacksonTypeManager();
store = new SqlParticipantContextStore(extension.getDataSourceRegistry(), extension.getDatasourceName(),
extension.getTransactionContext(), typeManager.getMapper(), queryExecutor, statements);

Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ edc-lib-jws2020 = { module = "org.eclipse.edc:jws2020-lib", version.ref = "edc"
edc-lib-store = { "module" = "org.eclipse.edc:store-lib", version.ref = "edc" }
edc-lib-transform = { module = "org.eclipse.edc:transform-lib", version.ref = "edc" }
edc-lib-util = { module = "org.eclipse.edc:util-lib", version.ref = "edc" }
edc-lib-json = { module = "org.eclipse.edc:json-lib", version.ref = "edc" }
edc-common-crypto = { module = "org.eclipse.edc:crypto-common-lib", version.ref = "edc" }
edc-core-jerseyproviders = { module = "org.eclipse.edc:jersey-providers-lib", version.ref = "edc" }

Expand Down
1 change: 1 addition & 0 deletions spi/identity-hub-spi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies {
exclude(group = "com.fasterxml.jackson.jaxrs", module = "jackson-jaxrs-json-provider")
}

testImplementation(libs.edc.lib.json)
testFixturesImplementation(libs.nimbus.jwt)
testFixturesImplementation(libs.edc.spi.identity.did)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package org.eclipse.edc.identityhub.spi.events.diddocument;

import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.spi.types.TypeManager;
import org.junit.jupiter.api.Test;

Expand All @@ -22,7 +23,7 @@

class DidDocumentPublishedTest {

private final TypeManager manager = new TypeManager();
private final TypeManager manager = new JacksonTypeManager();

@Test
void verify_serDes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package org.eclipse.edc.identityhub.spi.events.diddocument;

import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.spi.types.TypeManager;
import org.junit.jupiter.api.Test;

Expand All @@ -22,7 +23,7 @@

class DidDocumentUnpublishedTest {

private final TypeManager manager = new TypeManager();
private final TypeManager manager = new JacksonTypeManager();

@Test
void verify_serDes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
package org.eclipse.edc.identityhub.spi.events.keypair;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.spi.types.TypeManager;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class KeyPairAddedTest {

private final TypeManager typeManager = new TypeManager();
private final TypeManager typeManager = new JacksonTypeManager();

@Test
void verify_serDes() throws JsonProcessingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
package org.eclipse.edc.identityhub.spi.events.keypair;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.spi.types.TypeManager;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class KeyPairRevokedTest {

private final TypeManager typeManager = new TypeManager();
private final TypeManager typeManager = new JacksonTypeManager();

@Test
void verify_serDes() throws JsonProcessingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
package org.eclipse.edc.identityhub.spi.events.keypair;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.spi.types.TypeManager;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class KeyPairRotatedTest {

private final TypeManager typeManager = new TypeManager();
private final TypeManager typeManager = new JacksonTypeManager();

@Test
void verify_serDes() throws JsonProcessingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
package org.eclipse.edc.identityhub.spi.events.participant;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.spi.types.TypeManager;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class ParticipantContextCreatedTest {

private final TypeManager manager = new TypeManager();
private final TypeManager manager = new JacksonTypeManager();

@Test
void verify_serDes() throws JsonProcessingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
package org.eclipse.edc.identityhub.spi.events.participant;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.spi.types.TypeManager;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class ParticipantContextDeletedTest {

private final TypeManager manager = new TypeManager();
private final TypeManager manager = new JacksonTypeManager();

@Test
void verify_serDes() throws JsonProcessingException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
package org.eclipse.edc.identityhub.spi.events.participant;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.eclipse.edc.json.JacksonTypeManager;
import org.eclipse.edc.spi.types.TypeManager;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class ParticipantContextUpdatedTest {
private final TypeManager manager = new TypeManager();
private final TypeManager manager = new JacksonTypeManager();

@Test
void verify_serDes() throws JsonProcessingException {
Expand Down

0 comments on commit e00504e

Please sign in to comment.