File tree Expand file tree Collapse file tree
core/src/main/java/org/microshed/testing/jupiter Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131import org .junit .jupiter .api .extension .ExtensionContext ;
3232import org .junit .platform .commons .support .AnnotationSupport ;
3333import org .microshed .testing .ApplicationEnvironment ;
34+ import org .microshed .testing .SharedContainerConfig ;
3435import org .microshed .testing .jaxrs .RESTClient ;
3536import org .microshed .testing .jaxrs .RestClientBuilder ;
3637import org .microshed .testing .jwt .JwtBuilder ;
@@ -50,6 +51,12 @@ class MicroShedTestExtension implements BeforeAllCallback {
5051 @ Override
5152 public void beforeAll (ExtensionContext context ) throws Exception {
5253 Class <?> testClass = context .getRequiredTestClass ();
54+
55+ // Explicitly trigger static initialization of any SharedContainerConfig before we do further processing
56+ if (testClass .isAnnotationPresent (SharedContainerConfig .class )) {
57+ Class .forName (testClass .getAnnotation (SharedContainerConfig .class ).value ().getName ());
58+ }
59+
5360 ApplicationEnvironment config = ApplicationEnvironment .Resolver .load ();
5461 LOG .info ("Using ApplicationEnvironment class: " + config .getClass ().getCanonicalName ());
5562 config .applyConfiguration (testClass );
You can’t perform that action at this time.
0 commit comments