testsuite/integration/src/test/java/org/keycloak/testsuite/account/AccountTest.java
// More tests (including revoke) are in OAuthGrantTest

More tests (including revoke) are in OAuthGrantTest
More tests ( including revoke ) are in OAuthGrantTest
@Test
    public void applications() {
        applicationsPage.open();
        loginPage.login("test-user@localhost", "password");
        events.expectLogin().client("account").detail(Details.REDIRECT_URI, ACCOUNT_REDIRECT + "?path=applications").assertEvent();
        Assert.assertTrue(applicationsPage.isCurrent());
        Map<String, AccountApplicationsPage.AppEntry> apps = applicationsPage.getApplications();
        Assert.assertEquals(3, apps.size());
        AccountApplicationsPage.AppEntry accountEntry = apps.get("Account");
        Assert.assertEquals(2, accountEntry.getRolesAvailable().size());
        Assert.assertTrue(accountEntry.getRolesAvailable().contains("Manage account in Account"));
        Assert.assertTrue(accountEntry.getRolesAvailable().contains("View profile in Account"));
        Assert.assertEquals(1, accountEntry.getRolesGranted().size());
        Assert.assertTrue(accountEntry.getRolesGranted().contains("Full Access"));
        Assert.assertEquals(1, accountEntry.getProtocolMappersGranted().size());
        Assert.assertTrue(accountEntry.getProtocolMappersGranted().contains("Full Access"));
        AccountApplicationsPage.AppEntry testAppEntry = apps.get("test-app");
        Assert.assertEquals(4, testAppEntry.getRolesAvailable().size());
        Assert.assertTrue(testAppEntry.getRolesGranted().contains("Full Access"));
        Assert.assertTrue(testAppEntry.getProtocolMappersGranted().contains("Full Access"));
        AccountApplicationsPage.AppEntry thirdPartyEntry = apps.get("third-party");
        Assert.assertEquals(2, thirdPartyEntry.getRolesAvailable().size());
        Assert.assertTrue(thirdPartyEntry.getRolesAvailable().contains("Have User privileges"));
        Assert.assertTrue(thirdPartyEntry.getRolesAvailable().contains("Have Customer User privileges in test-app"));
        Assert.assertEquals(0, thirdPartyEntry.getRolesGranted().size());
        Assert.assertEquals(0, thirdPartyEntry.getProtocolMappersGranted().size());
    }
@ Test public void applications ( ) { applicationsPage . open ( ) ; loginPage . login ( "test-user@localhost" , "password" ) ; events . expectLogin ( ) . client ( "account" ) . detail ( Details . REDIRECT_URI , ACCOUNT_REDIRECT + "?path=applications" ) . assertEvent ( ) ; Assert . assertTrue ( applicationsPage . isCurrent ( ) ) ; Map < String , AccountApplicationsPage . AppEntry > apps = applicationsPage . getApplications ( ) ; Assert . assertEquals ( 3 , apps . size ( ) ) ; AccountApplicationsPage . AppEntry accountEntry = apps . get ( "Account" ) ; Assert . assertEquals ( 2 , accountEntry . getRolesAvailable ( ) . size ( ) ) ; Assert . assertTrue ( accountEntry . getRolesAvailable ( ) . contains ( "Manage account in Account" ) ) ; Assert . assertTrue ( accountEntry . getRolesAvailable ( ) . contains ( "View profile in Account" ) ) ; Assert . assertEquals ( 1 , accountEntry . getRolesGranted ( ) . size ( ) ) ; Assert . assertTrue ( accountEntry . getRolesGranted ( ) . contains ( "Full Access" ) ) ; Assert . assertEquals ( 1 , accountEntry . getProtocolMappersGranted ( ) . size ( ) ) ; Assert . assertTrue ( accountEntry . getProtocolMappersGranted ( ) . contains ( "Full Access" ) ) ; AccountApplicationsPage . AppEntry testAppEntry = apps . get ( "test-app" ) ; Assert . assertEquals ( 4 , testAppEntry . getRolesAvailable ( ) . size ( ) ) ; Assert . assertTrue ( testAppEntry . getRolesGranted ( ) . contains ( "Full Access" ) ) ; Assert . assertTrue ( testAppEntry . getProtocolMappersGranted ( ) . contains ( "Full Access" ) ) ; AccountApplicationsPage . AppEntry thirdPartyEntry = apps . get ( "third-party" ) ; Assert . assertEquals ( 2 , thirdPartyEntry . getRolesAvailable ( ) . size ( ) ) ; Assert . assertTrue ( thirdPartyEntry . getRolesAvailable ( ) . contains ( "Have User privileges" ) ) ; Assert . assertTrue ( thirdPartyEntry . getRolesAvailable ( ) . contains ( "Have Customer User privileges in test-app" ) ) ; Assert . assertEquals ( 0 , thirdPartyEntry . getRolesGranted ( ) . size ( ) ) ; Assert . assertEquals ( 0 , thirdPartyEntry . getProtocolMappersGranted ( ) . size ( ) ) ; }
More tests (including revoke) are in OAuthGrantTest
More tests ( including revoke ) are in OAuthGrantTest