@ParameterizedTest(name = "case {index}")
    @MethodSource("generateTestCases")
    @DisplayName("making sure incoming parameters are set correctly")
    void specTest(final TestCase tC) {
        var mock = mock(CloudWatchLogsClient.class);
        if (tC.logStreamExists) {
            when(mock.describeLogStreams(ArgumentMatchers.any(DescribeLogStreamsRequest.class))).thenReturn(createDescribeLogStreamsResult());
        }
        if (tC.logGroupExists) {
            when(mock.describeLogGroups(ArgumentMatchers.any(DescribeLogGroupsRequest.class))).thenReturn(createDescribeLogGroupsResult());
        }

        var appender = new CloudWatchAppender("test", "test", "test", "30", null,
            tC.createIfNeeded, tC.createLogGroupIfNeeded, tC.createLogStreamIfNeeded, mock);
        if (tC.throwsException) {
            assertThrows(RuntimeException.class, appender::initialize);
        } else {
            appender.initialize();

            val builder = ConfigurationBuilderFactory.newConfigurationBuilder();
            val configuration = builder.build();
            configuration.addAppender(appender);
            Configurator.initialize(configuration);

            val logger = LogManager.getLogger("test");
            logger.info("here is a message");

            createLogGroup(mock, Objects.requireNonNullElseGet(tC.resultCreateLogGroupIfNeeded,
                () -> Objects.requireNonNullElse(tC.createIfNeeded, true)));
            createLogStream(mock, Objects.requireNonNullElseGet(tC.resultCreateLogStreamIfNeeded,
                () -> Objects.requireNonNullElse(tC.createIfNeeded, true)));
        }

    }
This is {@code CloudWatchAppenderSpecTests}
@author Jonathon Johnson
@since 6.2.0
support/cas-server-support-aws-cloudwatch/src/test/java/org/apereo/cas/logging/CloudWatchAppenderSpecTests.java