From 31cc47c3138e97d896ca435ed086b2e76cbab7fb Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Tue, 14 Oct 2014 15:45:31 +1100 Subject: [PATCH] [MRM-1145] RSS tests do not correctly check responses --- .../java/org/apache/archiva/web/rss/RssFeedServletTest.java | 6 +----- .../java/org/apache/archiva/web/rss/SecuritySystemStub.java | 4 ++-- .../archiva-web-common/src/test/resources/log4j2-test.xml | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/RssFeedServletTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/RssFeedServletTest.java index 582a53225..194583f51 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/RssFeedServletTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/RssFeedServletTest.java @@ -447,14 +447,10 @@ public class RssFeedServletTest } - @Ignore + @Test public void testInvalidAuthenticationRequest() throws Exception { - //RssFeedServlet servlet = - // (RssFeedServlet) client.newInvocation( "http://localhost/feeds/unauthorized-repo" ).getServlet(); - - //WebRequest request = new GetMethodWebRequest( "http://localhost/feeds/unauthorized-repo" ); MockHttpServletRequest request = new MockHttpServletRequest(); request.setRequestURI( "/feeds/unauthorized-repo" ); diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java index 5a66698c3..53cfeb5cc 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/web/rss/SecuritySystemStub.java @@ -96,11 +96,11 @@ public class SecuritySystemStub } @Override - public AuthorizationResult authorize( SecuritySession arg0, String arg1, String arg2 ) + public AuthorizationResult authorize( SecuritySession arg0, String permission, String repositoryId ) throws AuthorizationException { - AuthorizationResult result = new AuthorizationResult( true, arg1, null ); + AuthorizationResult result = new AuthorizationResult( this.repoIds.contains( repositoryId ), permission, null ); return result; } diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/log4j2-test.xml index 17e6570f5..b80c0b0fa 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/log4j2-test.xml +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/log4j2-test.xml @@ -19,7 +19,7 @@ --> - + -- 2.39.5