Skip to content

Commit

Permalink
Merge pull request hapifhir#556 from trifork/feature/tester-configurable
Browse files Browse the repository at this point in the history
Feature/tester configurable
  • Loading branch information
patrick-werner authored Aug 22, 2023
2 parents 8b0623d + b4232e7 commit 0252fa4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ca.uhn.fhir.to.FhirTesterMvcConfig;
import ca.uhn.fhir.to.TesterConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

Expand All @@ -18,6 +19,7 @@
*/
@Configuration
@Import(FhirTesterMvcConfig.class)
@Conditional(FhirTesterConfigCondition.class)
public class FhirTesterConfig {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ca.uhn.fhir.jpa.starter.common;

import ca.uhn.fhir.jpa.starter.util.EnvironmentHelper;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.type.AnnotatedTypeMetadata;

public class FhirTesterConfigCondition implements Condition {
@Override
public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata metadata) {

var properties = EnvironmentHelper.getPropertiesStartingWith((ConfigurableEnvironment) conditionContext.getEnvironment(), "hapi.fhir.tester");
return !properties.isEmpty();
}
}

0 comments on commit 0252fa4

Please sign in to comment.