Skip to content

Commit

Permalink
Fix missing caches in SearchService integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Dec 2, 2022
1 parent 8fd2d0d commit a5f34f6
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ubic.gemma.core.search;

import org.springframework.cache.CacheManager;
import org.springframework.cache.concurrent.ConcurrentMapCache;
import org.springframework.context.annotation.Bean;
import ubic.gemma.core.annotation.reference.BibliographicReferenceService;
import ubic.gemma.core.association.phenotype.PhenotypeAssociationManagerService;
Expand All @@ -18,7 +19,9 @@
import ubic.gemma.persistence.service.genome.gene.GeneProductService;
import ubic.gemma.persistence.service.genome.taxon.TaxonService;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

/**
* Base class for mocking beans for
Expand All @@ -32,7 +35,9 @@ public SearchService searchService() {

@Bean
public CacheManager cacheManager() {
return mock( CacheManager.class );
CacheManager cacheManager = mock( CacheManager.class );
when( cacheManager.getCache( any() ) ).thenAnswer( a -> new ConcurrentMapCache( a.getArgument( 0 ) ) );
return cacheManager;
}

@Bean
Expand Down

0 comments on commit a5f34f6

Please sign in to comment.