Skip to content

Commit

Permalink
added @componentscan for e2e-bfd-test
Browse files Browse the repository at this point in the history
  • Loading branch information
smirnovaae committed Nov 22, 2024
1 parent 8cdd581 commit 152923c
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 60 deletions.
41 changes: 13 additions & 28 deletions e2e-bfd-test/src/test/java/gov/cms/ab2d/SpringBootApp.java
Original file line number Diff line number Diff line change
@@ -1,47 +1,32 @@
package gov.cms.ab2d;

import gov.cms.ab2d.common.feign.ContractFeignClient;
import gov.cms.ab2d.worker.bfdhealthcheck.BFDHealthCheckQuartzSetup;
import gov.cms.ab2d.worker.stuckjob.StuckJobQuartzSetup;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.retry.annotation.EnableRetry;

//@EnableJpaRepositories("com.*") @ComponentScan(basePackages = { "com.*" }) @EntityScan("com.*")
//@SpringBootApplication
@SpringBootApplication(scanBasePackages = {
"gov.cms.ab2d.bfd.client",
"gov.cms.ab2d.eventclient.clients",
"gov.cms.ab2d.snsclient.clients",
"gov.cms.ab2d.common.config",
"gov.cms.ab2d.common.feign",
"gov.cms.ab2d.common.model",
// "gov.cms.ab2d.common.properties",
"gov.cms.ab2d.common.properties",
"gov.cms.ab2d.common.repository",
"gov.cms.ab2d.common.service",
"gov.cms.ab2d.common.config",
// "gov.cms.ab2d.job",
// "gov.cms.ab2d.coverage",
// "gov.cms.ab2d.worker",
"gov.cms.ab2d.bfd.client",
"gov.cms.ab2d.contracts",
// "gov.cms.ab2d.worker.service",
// "gov.cms.ab2d.eventclient.clients",
// "gov.cms.ab2d.snsclient.clients"
"gov.cms.ab2d.coverage.repository",
"gov.cms.ab2d.coverage.service",
"gov.cms.ab2d.job.service",
"gov.cms.ab2d.worker.config",
"gov.cms.ab2d.worker.processor",
"gov.cms.ab2d.worker.service"
})
@EntityScan(basePackages = {"gov.cms.ab2d.common.model", "gov.cms.ab2d.common.properties",
"gov.cms.ab2d.common.service", "gov.cms.ab2d.common.config",
"gov.cms.ab2d.job.model", "gov.cms.ab2d.coverage.model",
"gov.cms.ab2d.properties.model",
"gov.cms.ab2d.contracts",
"gov.cms.ab2d.eventclient.clients", "gov.cms.ab2d.bfd.client"})
@EnableJpaRepositories(basePackages = {"gov.cms.ab2d.common.repository", "gov.cms.ab2d.job.repository",
"gov.cms.ab2d.coverage.repository"})
@EnableRetry
@PropertySource("classpath:application.common.properties")
//@Import({StuckJobQuartzSetup.class, BFDHealthCheckQuartzSetup.class})
@EnableFeignClients(clients = {ContractFeignClient.class})
@ImportAutoConfiguration({FeignAutoConfiguration.class})
public class SpringBootApp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,11 @@
import gov.cms.ab2d.job.service.JobService;
import gov.cms.ab2d.job.service.JobServiceImpl;
import gov.cms.ab2d.worker.config.ContractToContractCoverageMapping;
import gov.cms.ab2d.worker.processor.ContractProcessor;
import gov.cms.ab2d.worker.processor.JobPreProcessor;
import gov.cms.ab2d.worker.processor.JobPreProcessorImpl;
import gov.cms.ab2d.worker.processor.JobProcessor;
import gov.cms.ab2d.worker.processor.JobProcessorImpl;
import gov.cms.ab2d.worker.processor.JobProgressService;
import gov.cms.ab2d.worker.processor.JobProgressUpdateService;
import gov.cms.ab2d.worker.processor.coverage.CoverageDriver;
import gov.cms.ab2d.worker.processor.coverage.CoverageDriverImpl;
import gov.cms.ab2d.worker.processor.coverage.CoverageLockWrapper;
import gov.cms.ab2d.worker.processor.coverage.CoverageProcessor;
import gov.cms.ab2d.worker.processor.coverage.CoverageProcessorImpl;
import gov.cms.ab2d.worker.processor.*;
import gov.cms.ab2d.worker.processor.coverage.*;
import gov.cms.ab2d.worker.service.ContractWorkerClient;
import gov.cms.ab2d.worker.service.FileServiceImpl;
import gov.cms.ab2d.worker.service.JobChannelService;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import gov.cms.ab2d.worker.service.coveragesnapshot.CoverageSnapshotService;
import lombok.extern.slf4j.Slf4j;
import org.hl7.fhir.instance.model.api.IBaseBundle;
Expand All @@ -72,30 +50,38 @@
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Profile;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.util.ReflectionTestUtils;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.BlockingQueue;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static gov.cms.ab2d.common.util.PropertyConstants.PCP_CORE_POOL_SIZE;
import static gov.cms.ab2d.common.util.PropertyConstants.PCP_MAX_POOL_SIZE;
import static gov.cms.ab2d.common.util.PropertyConstants.PCP_SCALE_TO_MAX_TIME;
import static gov.cms.ab2d.common.util.PropertyConstants.*;
import static gov.cms.ab2d.fhir.BundleUtils.EOB;
import static gov.cms.ab2d.fhir.FhirVersion.R4;
import static gov.cms.ab2d.fhir.FhirVersion.STU3;
import static java.util.stream.Collectors.toList;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.params.provider.Arguments.arguments;

/**
Expand All @@ -108,7 +94,21 @@
* (except the last one). All the data pulls from BFDs sandbox Synthea data.
*/
@SpringBootTest
@ComponentScan(basePackages = {"gov.cms.ab2d.bfd.client"})
@ComponentScan(basePackages = {"gov.cms.ab2d.bfd.client",
"gov.cms.ab2d.eventclient.clients",
"gov.cms.ab2d.snsclient.clients",
"gov.cms.ab2d.common.config",
"gov.cms.ab2d.common.feign",
"gov.cms.ab2d.common.model",
"gov.cms.ab2d.common.properties",
"gov.cms.ab2d.common.repository",
"gov.cms.ab2d.common.service",
"gov.cms.ab2d.coverage.repository",
"gov.cms.ab2d.coverage.service",
"gov.cms.ab2d.job.service",
"gov.cms.ab2d.worker.config",
"gov.cms.ab2d.worker.processor",
"gov.cms.ab2d.worker.service"})
@Testcontainers
@Slf4j
@ExtendWith(MockitoExtension.class)
Expand Down Expand Up @@ -167,6 +167,10 @@ public class EndToEndBfdTests {
@Autowired
private CoverageSnapshotService snapshotService;

@Autowired
@Qualifier(value = "patientCoverageThreadPool")
private ThreadPoolTaskExecutor taskExecutor;

@TempDir
File path;

Expand Down

0 comments on commit 152923c

Please sign in to comment.