diff --git a/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/MetadataApiV1IntegrationTest.java b/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/MetadataApiV1IntegrationTest.java index adad2db..7827011 100644 --- a/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/MetadataApiV1IntegrationTest.java +++ b/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/MetadataApiV1IntegrationTest.java @@ -1,5 +1,6 @@ package org.cardanofoundation.tokenmetadata.registry.api; +import jakarta.persistence.EntityManager; import org.cardanofoundation.tokenmetadata.registry.api.config.SpringWebSecurityConfig; import org.cardanofoundation.tokenmetadata.registry.api.controller.MetadataApiController; import org.cardanofoundation.tokenmetadata.registry.api.indexer.V1ApiMetadataIndexer; @@ -40,6 +41,9 @@ public class MetadataApiV1IntegrationTest { @MockBean private V1ApiMetadataIndexer v1ApiMetadataIndexer; + @MockBean + private EntityManager entityManager; + @BeforeEach void setUp() { diff --git a/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/MetadataApiV2IntegrationTest.java b/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/MetadataApiV2IntegrationTest.java index 09e9c40..45f2737 100644 --- a/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/MetadataApiV2IntegrationTest.java +++ b/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/MetadataApiV2IntegrationTest.java @@ -1,5 +1,6 @@ package org.cardanofoundation.tokenmetadata.registry.api; +import jakarta.persistence.EntityManager; import org.cardanofoundation.tokenmetadata.registry.api.config.SpringWebSecurityConfig; import org.cardanofoundation.tokenmetadata.registry.api.controller.V2ApiController; import org.cardanofoundation.tokenmetadata.registry.api.indexer.V1ApiMetadataIndexer; @@ -43,6 +44,9 @@ public class MetadataApiV2IntegrationTest { @MockBean private V2ApiMetadataIndexer v2ApiMetadataIndexer; + @MockBean + private EntityManager entityManager; + @BeforeEach void setUp() { diff --git a/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/TokenMetadataRegistryApplicationTests.java b/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/TokenMetadataRegistryApplicationTests.java index 6829d5d..6aa4373 100644 --- a/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/TokenMetadataRegistryApplicationTests.java +++ b/api/src/test/java/org/cardanofoundation/tokenmetadata/registry/api/TokenMetadataRegistryApplicationTests.java @@ -1,12 +1,19 @@ package org.cardanofoundation.tokenmetadata.registry.api; +import jakarta.persistence.EntityManager; import org.junit.jupiter.api.Test; import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest; +import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.ActiveProfiles; @JdbcTest @ActiveProfiles("test") class TokenMetadataRegistryApplicationTests { - @Test - void contextLoads() {} + + @MockBean + private EntityManager entityManager; + + @Test + void contextLoads() { + } } diff --git a/common/src/main/java/org/cardanofoundation/tokenmetadata/registry/repository/TokenLogoRepository.java b/common/src/main/java/org/cardanofoundation/tokenmetadata/registry/repository/TokenLogoRepository.java index adb6db2..8fed4b4 100644 --- a/common/src/main/java/org/cardanofoundation/tokenmetadata/registry/repository/TokenLogoRepository.java +++ b/common/src/main/java/org/cardanofoundation/tokenmetadata/registry/repository/TokenLogoRepository.java @@ -1,10 +1,12 @@ package org.cardanofoundation.tokenmetadata.registry.repository; import org.cardanofoundation.tokenmetadata.registry.entity.TokenLogo; +import org.springframework.context.annotation.Profile; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository +@Profile("!test") public interface TokenLogoRepository extends JpaRepository { } diff --git a/common/src/main/java/org/cardanofoundation/tokenmetadata/registry/repository/TokenMetadataRepository.java b/common/src/main/java/org/cardanofoundation/tokenmetadata/registry/repository/TokenMetadataRepository.java index e375c17..27beb2c 100644 --- a/common/src/main/java/org/cardanofoundation/tokenmetadata/registry/repository/TokenMetadataRepository.java +++ b/common/src/main/java/org/cardanofoundation/tokenmetadata/registry/repository/TokenMetadataRepository.java @@ -1,10 +1,12 @@ package org.cardanofoundation.tokenmetadata.registry.repository; import org.cardanofoundation.tokenmetadata.registry.entity.TokenMetadata; +import org.springframework.context.annotation.Profile; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; @Repository +@Profile("!test") public interface TokenMetadataRepository extends JpaRepository { }