cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject git commit: Fixing IdP Metadata test
Date Mon, 22 Sep 2014 14:55:21 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master c55caad9d -> a4123e44f


Fixing IdP Metadata test


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/a4123e44
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/a4123e44
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/a4123e44

Branch: refs/heads/master
Commit: a4123e44f6015aeb26c5fef4f5f095ed882d7f76
Parents: c55caad
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Sep 22 15:55:08 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Sep 22 15:55:08 2014 +0100

----------------------------------------------------------------------
 .../service/idp/service/jpa/ConfigServiceJPA.java | 18 ++++++++++++------
 .../cxf/fediz/integrationtests/AbstractTests.java |  1 -
 2 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/a4123e44/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java
index fe1fac7..209052b 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/service/jpa/ConfigServiceJPA.java
@@ -48,16 +48,22 @@ public class ConfigServiceJPA implements ConfigService {
         Authentication currentAuthentication = SecurityContextHolder.getContext().getAuthentication();
         try {
             final Set<GrantedAuthority> authorities = new HashSet<GrantedAuthority>();
-            authorities.add(new SimpleGrantedAuthority("IDP_LIST"));
-            
-            UsernamePasswordAuthenticationToken technicalUser =
-                new UsernamePasswordAuthenticationToken("IDP_TEST", "N.A", authorities);
-            
-            SecurityContextHolder.getContext().setAuthentication(technicalUser);
             
             if (realm == null || realm.length() == 0) {
+                authorities.add(new SimpleGrantedAuthority("IDP_LIST"));
+                UsernamePasswordAuthenticationToken technicalUser =
+                    new UsernamePasswordAuthenticationToken("IDP_TEST", "N.A", authorities);
+                
+                SecurityContextHolder.getContext().setAuthentication(technicalUser);
+                
                 return idpService.getIdps(0, 1, Arrays.asList("all"), null).getIdps().iterator().next();
             } else {
+                authorities.add(new SimpleGrantedAuthority("IDP_READ"));
+                UsernamePasswordAuthenticationToken technicalUser =
+                    new UsernamePasswordAuthenticationToken("IDP_TEST", "N.A", authorities);
+                
+                SecurityContextHolder.getContext().setAuthentication(technicalUser);
+                
                 return idpService.getIdp(realm, Arrays.asList("all"));
             }
         } finally {

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/a4123e44/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
----------------------------------------------------------------------
diff --git a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
index 3ba99b9..63e3313 100644
--- a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
+++ b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
@@ -333,7 +333,6 @@ public abstract class AbstractTests {
     }
     
     @org.junit.Test
-    @org.junit.Ignore
     public void testIdPMetadata() throws Exception {
         String url = "https://localhost:" + getIdpHttpsPort() 
             + "/fediz-idp/FederationMetadata/2007-06/FederationMetadata.xml";


Mime
View raw message