@@ -36,10 +36,10 @@ public class PrefetchingUserManagerTest {
3636
3737 @ Mock
3838 ValueFactory valueFactory ;
39-
39+
4040 @ Mock
4141 InstallationLogger installationLogger ;
42-
42+
4343 @ Mock
4444 Group group1 ;
4545
@@ -48,22 +48,22 @@ public class PrefetchingUserManagerTest {
4848
4949 @ Mock
5050 Group group3 ;
51-
51+
5252 @ Mock
5353 User user1 ;
54-
54+
5555 @ Mock
5656 User user2 ;
5757
5858 @ Mock
5959 User userNonCached ;
60-
60+
6161 PrefetchingUserManager prefetchingUserManager ;
62-
62+
6363 @ Before
6464 public void before () throws RepositoryException {
65-
66- setupAuthorizable (group1 , "group1" , Collections .<Group >emptyList ());
65+
66+ setupAuthorizable (group1 , "group1" , Collections .<Group > emptyList ());
6767 setupAuthorizable (group2 , "group2" , Arrays .asList (group1 ));
6868 setupAuthorizable (group3 , "group3" , Arrays .asList (group2 ));
6969 setupAuthorizable (user1 , "user1" , Arrays .asList (group3 ));
@@ -72,7 +72,7 @@ public void before() throws RepositoryException {
7272
7373 when (userManager .findAuthorizables (any (Query .class ))).thenReturn (Arrays .asList (group1 , group2 , group3 , user1 , user2 ).iterator ());
7474 }
75-
75+
7676 private void setupAuthorizable (Authorizable auth , String id , List <Group > memberOf ) throws RepositoryException {
7777 when (auth .getID ()).thenReturn (id );
7878 when (auth .declaredMemberOf ()).thenReturn (memberOf .iterator ());
@@ -81,7 +81,7 @@ private void setupAuthorizable(Authorizable auth, String id, List<Group> memberO
8181 @ Test
8282 public void testPrefetchedAuthorizablesUserManager () throws RepositoryException {
8383 prefetchingUserManager = new PrefetchingUserManager (userManager , valueFactory , installationLogger );
84-
84+
8585 assertEquals (5 , prefetchingUserManager .getCacheSize ());
8686 assertEquals (group1 , prefetchingUserManager .getAuthorizable ("group1" ));
8787 assertEquals (null , prefetchingUserManager .getAuthorizable ("userNonCached" ));
@@ -99,60 +99,52 @@ public void testDelegation() throws RepositoryException {
9999 prefetchingUserManager .getAuthorizable (testPrincipal );
100100 verify (userManager , times (1 )).getAuthorizable (testPrincipal );
101101
102-
103-
104102 String userPath = "/home/users/path" ;
105103 prefetchingUserManager .getAuthorizableByPath (userPath );
106104 verify (userManager , times (1 )).getAuthorizableByPath (userPath );
107-
105+
108106 String relPath = "profile/test" ;
109107 String testVal = "testval" ;
110108 prefetchingUserManager .findAuthorizables (relPath , testVal );
111109 verify (userManager , times (1 )).findAuthorizables (relPath , testVal );
112110 prefetchingUserManager .findAuthorizables (relPath , testVal , UserManager .SEARCH_TYPE_AUTHORIZABLE );
113111 verify (userManager , times (1 )).findAuthorizables (relPath , testVal , UserManager .SEARCH_TYPE_AUTHORIZABLE );
114-
112+
115113 Query testQuery = new Query () {
116114 public <T > void build (QueryBuilder <T > builder ) {
117115 // fetch all authorizables
118116 }
119117 };
120118 prefetchingUserManager .findAuthorizables (testQuery );
121119 verify (userManager , times (1 )).findAuthorizables (testQuery );
122-
120+
123121 String testpw = "pw" ;
124122 prefetchingUserManager .createUser (testuser , testpw );
125123 verify (userManager , times (1 )).createUser (testuser , testpw );
126124
127125 prefetchingUserManager .createUser (testuser , testpw , testPrincipal , userPath );
128126 verify (userManager , times (1 )).createUser (testuser , testpw , testPrincipal , userPath );
129-
127+
130128 prefetchingUserManager .createSystemUser (testuser , userPath );
131129 verify (userManager , times (1 )).createSystemUser (testuser , userPath );
132-
130+
133131 prefetchingUserManager .createGroup (testuser );
134132 verify (userManager , times (1 )).createGroup (testuser );
135133
136134 prefetchingUserManager .createGroup (testPrincipal );
137135 verify (userManager , times (1 )).createGroup (testPrincipal );
138-
136+
139137 prefetchingUserManager .createGroup (testPrincipal , userPath );
140138 verify (userManager , times (1 )).createGroup (testPrincipal , userPath );
141139
142140 prefetchingUserManager .createGroup (testuser , testPrincipal , userPath );
143141 verify (userManager , times (1 )).createGroup (testuser , testPrincipal , userPath );
144-
142+
145143 prefetchingUserManager .autoSave (true );
146144 verify (userManager , times (1 )).autoSave (true );
147-
145+
148146 prefetchingUserManager .isAutoSave ();
149147 verify (userManager , times (1 )).isAutoSave ();
150148 }
151149
152-
153-
154-
155-
156-
157-
158150}
0 commit comments