Permalink
Browse files

Fix failing integration tests

Due to the introduction of DefaultSecurityPasswordService,
security-configuration.xml was now getting loaded prior to the test
security-configuration.xml file being copied into the proper location.
This caused the defaults to get loaded, and subsequently overwrite the
test security-configuration.xml with the defaults. The tests were then
being run with the defaults, which caused the failures.

Force a load of security-configuration.xml after the test file is in
place
  • Loading branch information...
1 parent a9b41e1 commit 69923fc035c8ba91609d6b1377c371a11b0ad427 @scarlucci scarlucci committed May 4, 2013
@@ -30,6 +30,7 @@
import org.sonatype.nexus.test.NexusTestSupport;
import org.sonatype.plexus.rest.resource.error.ErrorMessage;
import org.sonatype.plexus.rest.resource.error.ErrorResponse;
+import org.sonatype.security.configuration.source.SecurityConfigurationSource;
import org.sonatype.security.guice.SecurityModule;
import org.sonatype.sisu.ehcache.CacheManagerComponent;
@@ -99,6 +100,12 @@ protected void setUp()
this.copyDefaultSecurityConfigToPlace();
this.copyDefaultLdapConfigToPlace();
+
+ //Force a load of security-configuration.xml. Before we copy our test security-configuration.xml
+ //in place, a load is attempted, which forces defaults to be loaded. When the SecuritySystem
+ //is constructed, it then saves the configuration, which overwrites our test security-configuration.xml
+ //with the defaults
+ lookup(SecurityConfigurationSource.class, "file").loadConfiguration();
}
@Override

0 comments on commit 69923fc

Please sign in to comment.