Skip to content

Commit a4188d6

Browse files
authored
Ensure that user attributes are in expected format attrKey=attrVal for testing (#1583)
* Ensure that user attributes are in expected format attrKey=attrVal for testing Signed-off-by: Craig Perkins <cwperx@amazon.com> * Fix testDetector Signed-off-by: Craig Perkins <cwperx@amazon.com> --------- Signed-off-by: Craig Perkins <cwperx@amazon.com>
1 parent 0aefad9 commit a4188d6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/test/java/org/opensearch/securityanalytics/TestHelpers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2975,7 +2975,7 @@ public static SATIFSourceConfig randomSATIFSourceConfig(
29752975
feedFormat,
29762976
sourceConfigType,
29772977
description,
2978-
new User("wrgrer", List.of("b1"), List.of("r1"), List.of("ca")),
2978+
new User("wrgrer", List.of("b1"), List.of("r1"), List.of("attrKey=ca")),
29792979
createdAt,
29802980
source,
29812981
enabledTime,

src/test/java/org/opensearch/securityanalytics/model/WriteableTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void testDetectorAsAStream() throws IOException {
3535
public void testDetector() throws IOException { // an edge case of detector serialization that failed testDetectorAsAStream() intermittently
3636
String detectorString = "{\"type\":\"detector\",\"name\":\"MczAuRCrve\",\"detector_type\":\"test_windows\"," +
3737
"\"user\":{\"name\":\"QhKrfthgxw\",\"backend_roles\":[\"uYvGLCPhfX\",\"fOLkcRxMWR\"],\"roles\"" +
38-
":[\"YuucNpVzTm\",\"all_access\"],\"custom_attributes\":{\"test_attr\":\"test\"}," +
38+
":[\"YuucNpVzTm\",\"all_access\"],\"custom_attribute_names\":[\"test_attr=test\"]," +
3939
"\"user_requested_tenant\":null},\"threat_intel_enabled\":false,\"enabled\":false,\"enabled_time\"" +
4040
":null,\"schedule\":{\"period\":{\"interval\":5,\"unit\":\"MINUTES\"}},\"inputs\":[{\"detector_input\"" +
4141
":{\"description\":\"\",\"indices\":[],\"custom_rules\":[],\"pre_packaged_rules\":[]}}],\"triggers\"" +

src/test/java/org/opensearch/securityanalytics/model/threatintel/ThreatIntelAlertTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ private static ThreatIntelAlert getRandomAlert() {
8989
randomAlphaOfLength(10),
9090
randomLong(),
9191
randomLong(),
92-
new User(randomAlphaOfLength(10), List.of(randomAlphaOfLength(10)), List.of(randomAlphaOfLength(10)), List.of(randomAlphaOfLength(10))),
92+
new User(randomAlphaOfLength(10), List.of(randomAlphaOfLength(10)), List.of(randomAlphaOfLength(10)), List.of("attrKey=attrVal")),
9393
randomAlphaOfLength(10),
9494
randomAlphaOfLength(10),
9595
randomAlphaOfLength(10),

0 commit comments

Comments
 (0)