issue-2901 cleanup of code/imports

This commit is contained in:
leif stawnyczy 2021-09-07 12:08:32 -04:00
parent 69287b6bc3
commit 4d7f53851c
6 changed files with 6 additions and 18 deletions

View File

@ -21,7 +21,6 @@ package ca.uhn.fhir.jpa.api.dao;
*/ */
import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome; import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome;
import ca.uhn.fhir.jpa.api.model.DeleteConflictList; import ca.uhn.fhir.jpa.api.model.DeleteConflictList;
import ca.uhn.fhir.jpa.api.model.DeleteMethodOutcome; import ca.uhn.fhir.jpa.api.model.DeleteMethodOutcome;

View File

@ -22,7 +22,6 @@ package ca.uhn.fhir.jpa.api.dao;
import ca.uhn.fhir.jpa.api.model.ExpungeOptions; import ca.uhn.fhir.jpa.api.model.ExpungeOptions;
import ca.uhn.fhir.jpa.api.model.ExpungeOutcome; import ca.uhn.fhir.jpa.api.model.ExpungeOutcome;
import ca.uhn.fhir.rest.annotation.Offset;
import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.api.server.RequestDetails; import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.hl7.fhir.instance.model.api.IBaseBundle; import org.hl7.fhir.instance.model.api.IBaseBundle;

View File

@ -8,13 +8,10 @@ import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails; import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.Patient;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assertions.fail;
@ExtendWith(MockitoExtension.class)
class BaseHapiFhirResourceDaoTest { class BaseHapiFhirResourceDaoTest {
TestResourceDao mySvc = new TestResourceDao(); TestResourceDao mySvc = new TestResourceDao();

View File

@ -66,14 +66,6 @@ public class IdHelperServiceTest {
@InjectMocks @InjectMocks
private IdHelperService myIdHelperService; private IdHelperService myIdHelperService;
private ResourcePersistentId getResourcePersistentIdFromResource(IIdType theId, long thePid) {
ResourcePersistentId id = new ResourcePersistentId(thePid);
String idPortion = theId.getIdPart();
IIdType newId = new IdDt(theId.getResourceType(), idPortion);
id.setAssociatedResourceId(newId);
return id;
}
/** /**
* Gets a ResourceTable record for getResourceVersionsForPid * Gets a ResourceTable record for getResourceVersionsForPid
* Order matters! * Order matters!

View File

@ -590,7 +590,7 @@ public class FhirResourceDaoCreatePlaceholdersR4Test extends BaseJpaR4Test {
// create // create
Patient patient = new Patient(); Patient patient = new Patient();
patient.setIdElement(new IdType(patientId)); patient.setIdElement(new IdType(patientId));
myPatientDao.update(patient); myPatientDao.update(patient); // use update to use forcedid
// update // update
patient.setActive(true); patient.setActive(true);
@ -615,7 +615,9 @@ public class FhirResourceDaoCreatePlaceholdersR4Test extends BaseJpaR4Test {
assertNotNull(retObservation); assertNotNull(retObservation);
} }
/**
* This test is the same as above, except it uses the serverid (instead of forcedid)
*/
@Test @Test
public void testAutocreatePlaceholderWithExistingTargetWithServerAssignedIdTest() { public void testAutocreatePlaceholderWithExistingTargetWithServerAssignedIdTest() {
myDaoConfig.setAutoCreatePlaceholderReferenceTargets(true); myDaoConfig.setAutoCreatePlaceholderReferenceTargets(true);
@ -624,9 +626,9 @@ public class FhirResourceDaoCreatePlaceholdersR4Test extends BaseJpaR4Test {
// create // create
Patient patient = new Patient(); Patient patient = new Patient();
patient.setIdElement(new IdType("Patient")); patient.setIdElement(new IdType("Patient"));
DaoMethodOutcome ret = myPatientDao.create(patient); DaoMethodOutcome ret = myPatientDao.create(patient); // use create to use server id
// update // update - to update our version
patient.setActive(true); patient.setActive(true);
myPatientDao.update(patient); myPatientDao.update(patient);

View File

@ -1,7 +1,6 @@
package ca.uhn.fhir.jpa.dao.r4; package ca.uhn.fhir.jpa.dao.r4;
import ca.uhn.fhir.jpa.api.config.DaoConfig; import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome;
import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao; import ca.uhn.fhir.jpa.dao.BaseHapiFhirDao;
import ca.uhn.fhir.jpa.model.entity.ModelConfig; import ca.uhn.fhir.jpa.model.entity.ModelConfig;
import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel; import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel;