Skip to content

Commit 4c2e54d

Browse files
committed
fixup! Test
1 parent 02feaa0 commit 4c2e54d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

plugins/microsoft-graph-authz/src/test/java/org/elasticsearch/xpack/security/authz/microsoft/MicrosoftGraphAuthzRealmTests.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,25 +117,25 @@ public void tearDown() throws Exception {
117117
}
118118

119119
public void testLookupUser() {
120-
final var roleMapper = mockRoleMapper(Set.of(groupId), Set.of(roleName));
120+
try (var mockLog = MockLog.capture(MicrosoftGraphAuthzRealm.class)) {
121+
final var roleMapper = mockRoleMapper(Set.of(groupId), Set.of(roleName));
121122

122-
final var realmSettings = realmSettings().build();
123+
final var realmSettings = realmSettings().build();
123124

124-
final var config = new RealmConfig(realmId, realmSettings, env, threadContext);
125-
final var client = mock(GraphServiceClient.class);
126-
when(client.getRequestAdapter()).thenReturn(mock(RequestAdapter.class));
125+
final var config = new RealmConfig(realmId, realmSettings, env, threadContext);
126+
final var client = mock(GraphServiceClient.class);
127+
when(client.getRequestAdapter()).thenReturn(mock(RequestAdapter.class));
127128

128-
final var userRequestBuilder = mockGetUser(client);
129-
when(userRequestBuilder.get(any())).thenReturn(user(name, email));
129+
final var userRequestBuilder = mockGetUser(client);
130+
when(userRequestBuilder.get(any())).thenReturn(user(name, email));
130131

131-
final var graphGroupRequestBuilder = mockGetGroupMembership(userRequestBuilder);
132-
when(graphGroupRequestBuilder.get(any())).thenReturn(groupMembership(groupId));
132+
final var graphGroupRequestBuilder = mockGetGroupMembership(userRequestBuilder);
133+
when(graphGroupRequestBuilder.get(any())).thenReturn(groupMembership(groupId));
133134

134-
final var licenseState = mockLicense(true);
135+
final var licenseState = mockLicense(true);
135136

136-
final var realm = new MicrosoftGraphAuthzRealm(roleMapper, config, client, licenseState, threadPool);
137-
final var future = new PlainActionFuture<User>();
138-
try (var mockLog = MockLog.capture(MicrosoftGraphAuthzRealm.class)) {
137+
final var realm = new MicrosoftGraphAuthzRealm(roleMapper, config, client, licenseState, threadPool);
138+
final var future = new PlainActionFuture<User>();
139139
realm.lookupUser(username, future);
140140

141141
mockLog.addExpectation(

0 commit comments

Comments
 (0)