import org.apache.archiva.admin.model.proxyconnector.ProxyConnectorAdmin;
import org.apache.archiva.admin.model.proxyconnectorrule.ProxyConnectorRuleAdmin;
import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin;
+import org.apache.archiva.configuration.ArchivaConfiguration;
import org.apache.archiva.redback.role.RoleManager;
import org.apache.archiva.redback.users.User;
import org.apache.archiva.redback.users.memory.SimpleUser;
import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
+import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.inject.Inject;
import javax.inject.Named;
import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Inject
protected ProxyConnectorRuleAdmin proxyConnectorRuleAdmin;
+ @Inject
+ private ArchivaConfiguration archivaConfiguration;
+
+ @Before
+ public void initialize() {
+ Path confFile = Paths.get(System.getProperty( "appserver.base" ), "conf/archiva.xml");
+ try
+ {
+ Files.deleteIfExists( confFile );
+ archivaConfiguration.reload();
+ }
+ catch ( IOException e )
+ {
+ // ignore
+ }
+ }
+
protected AuditInformation getFakeAuditInformation()
{
AuditInformation auditInformation = new AuditInformation( getFakeUser(), "archiva-localhost" );