Improve updated JUnit test.

This commit is contained in:
ianmarshall 2020-06-09 11:52:51 -04:00
parent 4bf649c09c
commit 97e6d967e9
1 changed files with 11 additions and 3 deletions

View File

@ -6,6 +6,7 @@ import ca.uhn.fhir.jpa.model.entity.BinaryStorageEntity;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import org.hl7.fhir.r4.model.IdType;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@ -37,11 +38,18 @@ public class DatabaseBlobBinaryStorageSvcImplTest extends BaseJpaR4Test {
@Autowired
private DaoConfig myDaoConfig;
@After
public void resetDaoConfig() {
myDaoConfig.setPreloadBlobFromInputStream(false);
@Before
public void backupDaoConfig() {
defaultPreloadBlobFromInputStream = myDaoConfig.isPreloadBlobFromInputStream();
}
@After
public void restoreDaoConfig() {
myDaoConfig.setPreloadBlobFromInputStream(defaultPreloadBlobFromInputStream);
}
boolean defaultPreloadBlobFromInputStream;
@Test
public void testStoreAndRetrieve() throws IOException {