Repository: cxf-fediz
Updated Branches:
  refs/heads/1.3.x-fixes 6341ca762 -> fe4fbfe84


Adding test to verify that a user can't see the clients registered by another 
user


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

Branch: refs/heads/1.3.x-fixes
Commit: fe4fbfe8454113c7c4f0d3d47b5433c29ed624c4
Parents: 6341ca7
Author: Colm O hEigeartaigh <[email protected]>
Authored: Tue Apr 18 13:08:18 2017 +0100
Committer: Colm O hEigeartaigh <[email protected]>
Committed: Tue Apr 18 13:09:12 2017 +0100

----------------------------------------------------------------------
 .../cxf/fediz/systests/oidc/OIDCTest.java       | 24 +++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/fe4fbfe8/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java
----------------------------------------------------------------------
diff --git 
a/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java 
b/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java
index 1a97fe9..5266473 100644
--- 
a/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java
+++ 
b/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/OIDCTest.java
@@ -370,7 +370,29 @@ public class OIDCTest {
         
         webClient.close();
     }
-    
+
+    // Test that "bob" can't see the clients created by "alice"
+    @org.junit.Test
+    public void testRegisteredClientsAsBob() throws Exception {
+        String url = "https://localhost:"; + getRpHttpsPort() + 
"/fediz-oidc/console/clients";
+        String user = "bob";
+        String password = "bob";
+
+        // Login to the client page successfully
+        WebClient webClient = setupWebClient(user, password, 
getIdpHttpsPort());
+        HtmlPage loginPage = login(url, webClient);
+        final String bodyTextContent = loginPage.getBody().getTextContent();
+        Assert.assertTrue(bodyTextContent.contains("Registered Clients"));
+
+        // Get the new client identifier
+        HtmlTable table = loginPage.getHtmlElementById("registered_clients");
+
+        // 2 clients
+        Assert.assertEquals(table.getRows().size(), 1);
+
+        webClient.close();
+    }
+
     @org.junit.Test
     public void testOIDCLoginForClient1() throws Exception {
         

Reply via email to