@@ -39,6 +39,10 @@ public class TestRegistryResourceProvider extends AbstractRegistryResourceProvid
3939 * loads from the classloader and the order is not fixed.
4040 * Once these are created, then we can use the resource lookup to support retrieval.
4141 */
42+ @ Override
43+ public void init () {
44+ deferredLoad ();
45+ }
4246 private void deferredLoad () {
4347 if (registryResources == null ) {
4448 synchronized (TestRegistryResourceProvider .class ) {
@@ -78,23 +82,20 @@ private StructureDefinition generateStructureDefinition() {
7882
7983 @ Override
8084 protected List <FHIRRegistryResource > getRegistryResources (Class <? extends Resource > resourceType , String url ) {
81- deferredLoad ();
8285 return registryResources .stream ()
8386 .filter (rr -> rr .getResourceType () == resourceType && rr .getUrl ().equals (url ))
8487 .collect (Collectors .toList ());
8588 }
8689
8790 @ Override
8891 public Collection <FHIRRegistryResource > getRegistryResources (Class <? extends Resource > resourceType ) {
89- deferredLoad ();
9092 return registryResources .stream ()
9193 .filter (rr -> rr .getResourceType ().equals (resourceType ))
9294 .collect (Collectors .toSet ());
9395 }
9496
9597 @ Override
9698 public Collection <FHIRRegistryResource > getRegistryResources () {
97- deferredLoad ();
9899 return registryResources ;
99100 }
100101
@@ -105,7 +106,6 @@ public Collection<FHIRRegistryResource> getProfileResources(String type) {
105106
106107 @ Override
107108 public Collection <FHIRRegistryResource > getSearchParameterResources (String type ) {
108- deferredLoad ();
109109 return registryResources .stream ()
110110 .filter (rr -> rr .getResourceType () == SearchParameter .class )
111111 .filter (rr -> ((SearchParameter ) rr .getResource ()).getType ().getValue ().equals (type ))
0 commit comments