Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added a SampleHumanServicesTest class #1311

Closed
84 changes: 74 additions & 10 deletions src/test/java/org/openelisglobal/AppTestConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@

import static org.mockito.Mockito.mock;

import ca.uhn.fhir.context.FhirContext;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.ArrayList;
import java.util.List;
import lombok.NonNull;
import org.apache.http.impl.client.CloseableHttpClient;
import org.openelisglobal.audittrail.dao.AuditTrailService;
import org.openelisglobal.citystatezip.service.CityStateZipService;
import org.openelisglobal.common.services.IStatusService;
import org.openelisglobal.common.util.Versioning;
import org.openelisglobal.dataexchange.fhir.FhirConfig;
import org.openelisglobal.dataexchange.fhir.FhirUtil;
import org.openelisglobal.dataexchange.fhir.service.FhirPersistanceService;
import org.openelisglobal.dataexchange.fhir.service.FhirTransformService;
import org.openelisglobal.dataexchange.service.order.ElectronicOrderService;
import org.openelisglobal.externalconnections.service.BasicAuthenticationDataService;
import org.openelisglobal.externalconnections.service.ExternalConnectionService;
Expand All @@ -21,7 +27,8 @@
import org.openelisglobal.notification.service.TestNotificationConfigService;
import org.openelisglobal.observationhistory.service.ObservationHistoryService;
import org.openelisglobal.observationhistorytype.service.ObservationHistoryTypeService;
import org.openelisglobal.organization.service.OrganizationService;
import org.openelisglobal.panel.service.PanelService;
import org.openelisglobal.panelitem.service.PanelItemService;
import org.openelisglobal.program.service.ImmunohistochemistrySampleService;
import org.openelisglobal.program.service.PathologySampleService;
import org.openelisglobal.program.service.ProgramSampleService;
Expand All @@ -35,9 +42,11 @@
import org.openelisglobal.sampleqaevent.service.SampleQaEventService;
import org.openelisglobal.siteinformation.service.SiteInformationService;
import org.openelisglobal.statusofsample.service.StatusOfSampleService;
import org.openelisglobal.systemusersection.service.SystemUserSectionService;
import org.openelisglobal.test.dao.TestDAO;
import org.openelisglobal.test.service.TestSectionService;
import org.openelisglobal.test.service.TestServiceImpl;
import org.openelisglobal.testanalyte.service.TestAnalyteService;
import org.openelisglobal.testresult.service.TestResultService;
import org.openelisglobal.typeofsample.service.TypeOfSampleService;
import org.openelisglobal.typeofsample.service.TypeOfSampleTestService;
Expand Down Expand Up @@ -77,9 +86,10 @@
"org.openelisglobal.view", "org.openelisglobal.search.service", "org.openelisglobal.sample",
"org.openelisglobal.sampleitem.", "org.openelisglobal.analysis", "org.openelisglobal.result.service",
"org.openelisglobal.result.daoimpl", "org.openelisglobal.resultlimit", "org.openelisglobal.resultlimits",
"org.openelisglobal.typeoftestresult", "org.openelisglobal.samplehuman",
"org.openelisglobal.role", }, excludeFilters = {
"org.openelisglobal.typeoftestresult", "org.openelisglobal.samplehuman", "org.openelisglobal.role",
"org.openelisglobal.organization" }, excludeFilters = {
@ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openelisglobal.patient.controller.*"),
@ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openelisglobal.organization.controller.*"),
@ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openelisglobal.sample.controller.*"),
@ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openelisglobal.dictionary.controller.*.java"),
@ComponentScan.Filter(type = FilterType.REGEX, pattern = "org.openelisglobal.config.*"),
Expand All @@ -101,12 +111,66 @@ public LocalizationServiceImpl localise() {
return mock(LocalizationServiceImpl.class);
}

@Bean()
@Profile("test")
public FhirContext fhirContext() {
return mock(FhirContext.class);
}

@Bean()
@Profile("test")
public FhirTransformService fhirTransformService() {
return mock(FhirTransformService.class);
}

@Bean()
@Profile("test")
public PanelService panelService() {
return mock(PanelService.class);
}

@Bean()
@Profile("test")
public PanelItemService panelItemService() {
return mock(PanelItemService.class);
}

@Bean()
@Profile("test")
public SystemUserSectionService stemUserSectionService() {
return mock(SystemUserSectionService.class);
}

@Bean()
@Profile("test")
public TestAnalyteService testAnalyteService() {
return mock(TestAnalyteService.class);
}

@Bean()
@Profile("test")
public FhirUtil fhirUtil() {
return mock(FhirUtil.class);
}

@Bean()
@Profile("test")
public FhirConfig fhirConfig() {
return mock(FhirConfig.class);
}

@Bean()
@Profile("test")
public LocalizationDAO localiseDao() {
return mock(LocalizationDAO.class);
}

@Bean()
@Profile("test")
public CloseableHttpClient cityStateZipServiceloseableHttpClient() {
return mock(CloseableHttpClient.class);
}

@Bean()
@Profile("test")
public ExternalConnectionService externalConnectService() {
Expand Down Expand Up @@ -143,12 +207,6 @@ public RequesterTypeService requesterTypeService() {
return mock(RequesterTypeService.class);
}

@Bean()
@Profile("test")
public OrganizationService organizationService() {
return mock(OrganizationService.class);
}

@Bean()
@Profile("test")
public BasicAuthenticationDataService basicAuthenticationDataService() {
Expand Down Expand Up @@ -239,6 +297,12 @@ public ReferralResultService ReferralResultService() {
return mock(ReferralResultService.class);
}

@Bean()
@Profile("test")
public CityStateZipService cityStateZipService() {
return mock(CityStateZipService.class);
}

@Bean()
@Profile("test")
public ReferralService referralService() {
Expand Down Expand Up @@ -346,4 +410,4 @@ public void configureMessageConverters(@NonNull List<HttpMessageConverter<?>> co
converters.add(new StringHttpMessageConverter());
converters.add(jsonConverter());
}
}
}
Loading
Loading