Repository: cxf-fediz
Updated Branches:
  refs/heads/master 5f7522979 -> 02df115e9


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/02df115e
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/02df115e
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/02df115e

Branch: refs/heads/master
Commit: 02df115e99a02dde43079e4fac10ed9d0d5ec69c
Parents: 5f75229
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:08:18 2017 +0100

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


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/02df115e/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 92f09d6..df04250 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
@@ -374,6 +374,28 @@ 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