summaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-03-21 13:33:28 +0000
committerOlivier Lamy <olamy@apache.org>2012-03-21 13:33:28 +0000
commit08f98d5369722395757c5138f06cb069cc4bfbe6 (patch)
tree37183002d59816051723602bee169b82a60474f1 /archiva-modules
parentdecae4e3652f6327f4d2811ced3a2ab328ea5d13 (diff)
downloadarchiva-08f98d5369722395757c5138f06cb069cc4bfbe6.tar.gz
archiva-08f98d5369722395757c5138f06cb069cc4bfbe6.zip
fix junit
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1303389 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/security/UserRepositoriesStub.java4
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/DeleteArtifactActionTest.java9
2 files changed, 4 insertions, 9 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/security/UserRepositoriesStub.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/security/UserRepositoriesStub.java
index fb0e2105c..f8b9dc075 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/security/UserRepositoriesStub.java
+++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/security/UserRepositoriesStub.java
@@ -53,12 +53,12 @@ public class UserRepositoriesStub
public boolean isAuthorizedToUploadArtifacts( String principal, String repoId )
throws ArchivaSecurityException
{
- return false;
+ return true;
}
public boolean isAuthorizedToDeleteArtifacts( String principal, String repoId )
{
- return false;
+ return true;
}
public List<String> getManagableRepositoryIds( String principal )
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/DeleteArtifactActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/DeleteArtifactActionTest.java
index 6a8df1216..dcf370ba3 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/DeleteArtifactActionTest.java
+++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/archiva/web/action/DeleteArtifactActionTest.java
@@ -19,6 +19,7 @@ package org.apache.archiva.web.action;
* under the License.
*/
+import com.opensymphony.xwork2.Action;
import net.sf.beanlib.provider.replicator.BeanReplicator;
import org.apache.archiva.admin.model.beans.ManagedRepository;
import org.apache.archiva.admin.repository.managed.DefaultManagedRepositoryAdmin;
@@ -35,19 +36,13 @@ import org.apache.archiva.rest.services.DefaultRepositoriesService;
import org.apache.archiva.webtest.memory.TestRepositorySessionFactory;
import org.apache.commons.lang.StringUtils;
import org.apache.struts2.StrutsSpringTestCase;
-import org.codehaus.plexus.redback.users.User;
-import org.codehaus.redback.rest.services.RedbackAuthenticationThreadLocal;
-import org.codehaus.redback.rest.services.RedbackRequestInformation;
import org.easymock.MockControl;
import org.easymock.classextension.MockClassControl;
import java.io.File;
import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.never;
import static org.mockito.Mockito.when;
public class DeleteArtifactActionTest
@@ -151,7 +146,7 @@ public class DeleteArtifactActionTest
repositoryFactoryControl.replay();
metadataRepositoryControl.replay();
- action.doDelete();
+ assertEquals( Action.SUCCESS, action.doDelete() );
String artifactPath =
REPO_LOCATION + "/" + StringUtils.replace( GROUP_ID, ".", "/" ) + "/" + StringUtils.replace( ARTIFACT_ID,