Skip to content

Commit 674b07e

Browse files
author
Vladimir Kotal
committed
fix AuthorizationFramework instantiation
1 parent 421d1ec commit 674b07e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plugins/LdapPlugin/test/opengrok/auth/plugin/LdapAttrTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* CDDL HEADER END
1818
*/
1919

20-
/*
20+
/*
2121
* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package opengrok.auth.plugin;
@@ -49,6 +49,7 @@ public class LdapAttrTest {
4949

5050
private HttpServletRequest dummyRequest;
5151
private LdapAttr plugin;
52+
private AuthorizationFramework framework;
5253

5354
private static File whitelistFile;
5455

@@ -77,7 +78,8 @@ public void setUp() {
7778

7879
plugin.load(parameters);
7980

80-
AuthorizationFramework.getInstance().setPluginVersion(1);
81+
framework = new AuthorizationFramework(null);
82+
framework.setPluginVersion(1);
8183
}
8284

8385
private void prepareRequest(String username, String mail, String... ous) {
@@ -152,7 +154,7 @@ public void testInvalidateSession() {
152154
Assert.assertTrue(plugin.isAllowed(dummyRequest, makeGroup("Group 1")));
153155
Assert.assertTrue(plugin.isAllowed(dummyRequest, makeGroup("Group 2")));
154156

155-
AuthorizationFramework.getInstance().increasePluginVersion();
157+
framework.increasePluginVersion();
156158
prepareRequest("007", "[email protected]", "MI6", "MI7");
157159

158160
Assert.assertTrue(plugin.isAllowed(dummyRequest, makeProject("Random Project")));

0 commit comments

Comments
 (0)