Completed fixing tests after enabling pre-expansion by default.

This commit is contained in:
Diederik Muylwyk 2019-09-25 14:29:50 -04:00
parent 6b22d705c7
commit 30588bf8ee
4 changed files with 10 additions and 5 deletions

View File

@ -537,6 +537,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
@Test @Test
public void testIndexNoDuplicatesUri() { public void testIndexNoDuplicatesUri() {
ValueSet res = new ValueSet(); ValueSet res = new ValueSet();
res.setUrl("http://www.example.org/vs");
res.getCompose().addInclude().setSystem("http://foo"); res.getCompose().addInclude().setSystem("http://foo");
res.getCompose().addInclude().setSystem("http://bar"); res.getCompose().addInclude().setSystem("http://bar");
res.getCompose().addInclude().setSystem("http://foo"); res.getCompose().addInclude().setSystem("http://foo");
@ -549,7 +550,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
Class<ResourceIndexedSearchParamUri> type = ResourceIndexedSearchParamUri.class; Class<ResourceIndexedSearchParamUri> type = ResourceIndexedSearchParamUri.class;
List<?> results = myEntityManager.createQuery("SELECT i FROM " + type.getSimpleName() + " i WHERE i.myMissing = false", type).getResultList(); List<?> results = myEntityManager.createQuery("SELECT i FROM " + type.getSimpleName() + " i WHERE i.myMissing = false", type).getResultList();
ourLog.info(toStringMultiline(results)); ourLog.info(toStringMultiline(results));
assertEquals(2, results.size()); assertEquals(3, results.size());
List<IIdType> actual = toUnqualifiedVersionlessIds(myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(ValueSet.SP_REFERENCE, new UriParam("http://foo")))); List<IIdType> actual = toUnqualifiedVersionlessIds(myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(ValueSet.SP_REFERENCE, new UriParam("http://foo"))));
assertThat(actual, contains(id)); assertThat(actual, contains(id));
@ -2161,13 +2162,14 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
} }
@Test @Test
public void testSearchUriWrongParam() throws Exception { public void testSearchUriWrongParam() {
ValueSet v1 = new ValueSet(); ValueSet v1 = new ValueSet();
v1.getUrlElement().setValue("http://foo"); v1.getUrlElement().setValue("http://foo");
String id1 = myValueSetDao.create(v1).getId().toUnqualifiedVersionless().getValue(); String id1 = myValueSetDao.create(v1).getId().toUnqualifiedVersionless().getValue();
ValueSet v2 = new ValueSet(); ValueSet v2 = new ValueSet();
v2.getExpansion().getIdentifierElement().setValue("http://foo"); v2.getExpansion().getIdentifierElement().setValue("http://foo");
v2.getUrlElement().setValue("http://www.example.org/vs");
String id2 = myValueSetDao.create(v2).getId().toUnqualifiedVersionless().getValue(); String id2 = myValueSetDao.create(v2).getId().toUnqualifiedVersionless().getValue();
{ {

View File

@ -914,6 +914,7 @@ public class FhirResourceDaoR4SearchNoFtTest extends BaseJpaR4Test {
@Test @Test
public void testIndexNoDuplicatesUri() { public void testIndexNoDuplicatesUri() {
ValueSet res = new ValueSet(); ValueSet res = new ValueSet();
res.setUrl("http://www.example.org/vs");
res.getCompose().addInclude().setSystem("http://foo"); res.getCompose().addInclude().setSystem("http://foo");
res.getCompose().addInclude().setSystem("http://bar"); res.getCompose().addInclude().setSystem("http://bar");
res.getCompose().addInclude().setSystem("http://foo"); res.getCompose().addInclude().setSystem("http://foo");
@ -927,7 +928,7 @@ public class FhirResourceDaoR4SearchNoFtTest extends BaseJpaR4Test {
Class<ResourceIndexedSearchParamUri> type = ResourceIndexedSearchParamUri.class; Class<ResourceIndexedSearchParamUri> type = ResourceIndexedSearchParamUri.class;
List<?> results = myEntityManager.createQuery("SELECT i FROM " + type.getSimpleName() + " i WHERE i.myMissing = false", type).getResultList(); List<?> results = myEntityManager.createQuery("SELECT i FROM " + type.getSimpleName() + " i WHERE i.myMissing = false", type).getResultList();
ourLog.info(toStringMultiline(results)); ourLog.info(toStringMultiline(results));
assertEquals(2, results.size()); assertEquals(3, results.size());
}); });
List<IIdType> actual = toUnqualifiedVersionlessIds(myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(ValueSet.SP_REFERENCE, new UriParam("http://foo")))); List<IIdType> actual = toUnqualifiedVersionlessIds(myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(ValueSet.SP_REFERENCE, new UriParam("http://foo"))));
@ -2944,6 +2945,7 @@ public class FhirResourceDaoR4SearchNoFtTest extends BaseJpaR4Test {
ValueSet v2 = new ValueSet(); ValueSet v2 = new ValueSet();
v2.getExpansion().getIdentifierElement().setValue("http://foo"); v2.getExpansion().getIdentifierElement().setValue("http://foo");
v2.getUrlElement().setValue("http://www.example.org/vs");
String id2 = myValueSetDao.create(v2).getId().toUnqualifiedVersionless().getValue(); String id2 = myValueSetDao.create(v2).getId().toUnqualifiedVersionless().getValue();
{ {

View File

@ -772,6 +772,7 @@ public class FhirResourceDaoR4SearchNoHashesTest extends BaseJpaR4Test {
@Test @Test
public void testIndexNoDuplicatesUri() { public void testIndexNoDuplicatesUri() {
ValueSet res = new ValueSet(); ValueSet res = new ValueSet();
res.setUrl("http://www.example.org/vs");
res.getCompose().addInclude().setSystem("http://foo"); res.getCompose().addInclude().setSystem("http://foo");
res.getCompose().addInclude().setSystem("http://bar"); res.getCompose().addInclude().setSystem("http://bar");
res.getCompose().addInclude().setSystem("http://foo"); res.getCompose().addInclude().setSystem("http://foo");
@ -785,7 +786,7 @@ public class FhirResourceDaoR4SearchNoHashesTest extends BaseJpaR4Test {
Class<ResourceIndexedSearchParamUri> type = ResourceIndexedSearchParamUri.class; Class<ResourceIndexedSearchParamUri> type = ResourceIndexedSearchParamUri.class;
List<?> results = myEntityManager.createQuery("SELECT i FROM " + type.getSimpleName() + " i WHERE i.myMissing = false", type).getResultList(); List<?> results = myEntityManager.createQuery("SELECT i FROM " + type.getSimpleName() + " i WHERE i.myMissing = false", type).getResultList();
ourLog.info(toStringMultiline(results)); ourLog.info(toStringMultiline(results));
assertEquals(2, results.size()); assertEquals(3, results.size());
}); });
List<IIdType> actual = toUnqualifiedVersionlessIds(myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(ValueSet.SP_REFERENCE, new UriParam("http://foo")))); List<IIdType> actual = toUnqualifiedVersionlessIds(myValueSetDao.search(new SearchParameterMap().setLoadSynchronous(true).add(ValueSet.SP_REFERENCE, new UriParam("http://foo"))));

View File

@ -3919,7 +3919,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
.returnBundle(Bundle.class) .returnBundle(Bundle.class)
.execute(); .execute();
final String uuid2 = toSearchUuidFromLinkNext(result2); final String uuid2 = toSearchUuidFromLinkNext(result2);
assertNotEquals(uuid1, uuid2); // TODO: DM 2019-09-24 - This test fails intermittently; I suspect it's a timing issue with sleepOneClick(); assertNotEquals(uuid1, uuid2); // TODO: DM 2019-09-24 - This assertion fails intermittently.
} }
/* /*