Skip to content

Commit

Permalink
fix: fixed tests configuration for entity manager
Browse files Browse the repository at this point in the history
  • Loading branch information
nemo83 committed Feb 9, 2024
1 parent a53b761 commit 85a286c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -40,6 +41,9 @@ public class MetadataApiV1IntegrationTest {
@MockBean
private V1ApiMetadataIndexer v1ApiMetadataIndexer;

@MockBean
private EntityManager entityManager;

@BeforeEach
void setUp() {

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -43,6 +44,9 @@ public class MetadataApiV2IntegrationTest {
@MockBean
private V2ApiMetadataIndexer v2ApiMetadataIndexer;

@MockBean
private EntityManager entityManager;

@BeforeEach
void setUp() {

Expand Down
Original file line number Diff line number Diff line change
@@ -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() {
}
}
Original file line number Diff line number Diff line change
@@ -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<TokenLogo, String> {

}
Original file line number Diff line number Diff line change
@@ -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<TokenMetadata, String> {

}

0 comments on commit 85a286c

Please sign in to comment.