Skip to content

Commit 2ec60f6

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent f3865b2 commit 2ec60f6

File tree

3 files changed

+40
-29
lines changed
  • build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/dependencies/patches
  • plugins/microsoft-graph-authz/src/test/java/org/elasticsearch/xpack/security/authz/microsoft
  • x-pack/plugin/security/qa/microsoft-graph-authz-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/authz/microsoft

3 files changed

+40
-29
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/dependencies/patches/Utils.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@
2323
import java.util.Enumeration;
2424
import java.util.HexFormat;
2525
import java.util.Locale;
26-
import java.util.Map;
2726
import java.util.function.Function;
28-
import java.util.jar.Attributes;
2927
import java.util.jar.JarEntry;
3028
import java.util.jar.JarFile;
3129
import java.util.jar.JarOutputStream;
32-
import java.util.jar.Manifest;
3330
import java.util.stream.Collectors;
3431

3532
import static org.objectweb.asm.ClassWriter.COMPUTE_FRAMES;

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

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,23 @@ public void testLookupUser() {
138138
realm.lookupUser(username, future);
139139

140140
try (var mockLog = MockLog.capture(MicrosoftGraphAuthzRealm.class)) {
141-
mockLog.addExpectation(new MockLog.SeenEventExpectation(
142-
"Fetch user properties",
143-
MicrosoftGraphAuthzRealm.class.getName(),
144-
Level.TRACE,
145-
Strings.format("Fetched user with name [%s] and email [%s] from Microsoft Graph", name, email)
146-
));
147-
148-
mockLog.addExpectation(new MockLog.SeenEventExpectation(
149-
"Fetch group membership",
150-
MicrosoftGraphAuthzRealm.class.getName(),
151-
Level.TRACE,
152-
Strings.format("Fetched [1] groups from Microsoft Graph: [%s]", groupId)
153-
));
141+
mockLog.addExpectation(
142+
new MockLog.SeenEventExpectation(
143+
"Fetch user properties",
144+
MicrosoftGraphAuthzRealm.class.getName(),
145+
Level.TRACE,
146+
Strings.format("Fetched user with name [%s] and email [%s] from Microsoft Graph", name, email)
147+
)
148+
);
149+
150+
mockLog.addExpectation(
151+
new MockLog.SeenEventExpectation(
152+
"Fetch group membership",
153+
MicrosoftGraphAuthzRealm.class.getName(),
154+
Level.TRACE,
155+
Strings.format("Fetched [1] groups from Microsoft Graph: [%s]", groupId)
156+
)
157+
);
154158

155159
final var user = future.actionGet();
156160
assertThat(user.principal(), equalTo(username));
@@ -181,12 +185,14 @@ public void testHandleGetUserPropertiesError() {
181185
final var future = new PlainActionFuture<User>();
182186

183187
try (var mockLog = MockLog.capture(MicrosoftGraphAuthzRealm.class)) {
184-
mockLog.addExpectation(new MockLog.SeenEventExpectation(
185-
"Log exception",
186-
MicrosoftGraphAuthzRealm.class.getName(),
187-
Level.ERROR,
188-
Strings.format("Failed to authorize [{}] with MS Graph realm", username)
189-
));
188+
mockLog.addExpectation(
189+
new MockLog.SeenEventExpectation(
190+
"Log exception",
191+
MicrosoftGraphAuthzRealm.class.getName(),
192+
Level.ERROR,
193+
Strings.format("Failed to authorize [{}] with MS Graph realm", username)
194+
)
195+
);
190196

191197
realm.lookupUser(username, future);
192198
final var thrown = assertThrows(ODataError.class, future::actionGet);
@@ -217,12 +223,14 @@ public void testHandleGetGroupMembershipError() {
217223
final var future = new PlainActionFuture<User>();
218224

219225
try (var mockLog = MockLog.capture(MicrosoftGraphAuthzRealm.class)) {
220-
mockLog.addExpectation(new MockLog.SeenEventExpectation(
221-
"Log exception",
222-
MicrosoftGraphAuthzRealm.class.getName(),
223-
Level.ERROR,
224-
Strings.format("Failed to authorize [{}] with MS Graph realm", username)
225-
));
226+
mockLog.addExpectation(
227+
new MockLog.SeenEventExpectation(
228+
"Log exception",
229+
MicrosoftGraphAuthzRealm.class.getName(),
230+
Level.ERROR,
231+
Strings.format("Failed to authorize [{}] with MS Graph realm", username)
232+
)
233+
);
226234

227235
realm.lookupUser(username, future);
228236
final var thrown = assertThrows(ODataError.class, future::actionGet);

x-pack/plugin/security/qa/microsoft-graph-authz-tests/src/javaRestTest/java/org/elasticsearch/xpack/security/authz/microsoft/MicrosoftGraphAuthzPluginIT.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ public class MicrosoftGraphAuthzPluginIT extends ESRestTestCase {
6464
List.of("unmapped-group-1", "unmapped-group-2", "unmapped-group-3", EXPECTED_GROUP),
6565
List.of("microsoft_graph_user")
6666
),
67-
new MicrosoftGraphHttpFixture.TestUser("User2", "User 2", "[email protected]", List.of(EXPECTED_GROUP), List.of("microsoft_graph_user")),
67+
new MicrosoftGraphHttpFixture.TestUser(
68+
"User2",
69+
"User 2",
70+
71+
List.of(EXPECTED_GROUP),
72+
List.of("microsoft_graph_user")
73+
),
6874
new MicrosoftGraphHttpFixture.TestUser("User3", "User 3", "[email protected]", List.of(), List.of())
6975
);
7076

0 commit comments

Comments
 (0)