mirror of
https://github.com/floci-io/floci.git
synced 2026-11-28 16:11:48 -05:00
fix(logs): refuse FilterLogEvents requests that name no log group (#6693)
This commit is contained in:
1 parent
45d4c28e33
commit
322a6a0977
5 files changed
+84
-3
No files matched your search
+11
@@ -85,6 +85,17 @@ class CloudWatchLogsFilterPatternTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("a request naming no log group is refused with InvalidParameterException")
|
||||
void aRequestNamingNoLogGroupIsRefused() {
|
||||
// Not measured on AWS: the API reference requires logGroupName or logGroupIdentifier and models
|
||||
// InvalidParameterException for a parameter specified incorrectly.
|
||||
try (CloudWatchLogsClient logs = TestFixtures.cloudWatchLogsClient()) {
|
||||
assertThatThrownBy(() -> logs.filterLogEvents(request -> request.filterPattern("ERROR")))
|
||||
.isInstanceOf(InvalidParameterException.class);
|
||||
}
|
||||
}
|
||||
|
||||
/** The 1-based positions in {@link #EVENTS} of the events the pattern matches, oldest first. */
|
||||
private static List<Integer> matches(CloudWatchLogsClient logs, String groupName, String pattern) {
|
||||
List<Integer> positions = new ArrayList<>();
|
||||
|
||||
Reference in new issue
Block a user