Class JobIDLoggingUtil


  • public class JobIDLoggingUtil
    extends Object
    Utility class for verifying the presence and correctness of a specific key-value pair in the logging context of log events.
    • Constructor Detail

      • JobIDLoggingUtil

        public JobIDLoggingUtil()
    • Method Detail

      • assertKeyPresent

        public static void assertKeyPresent​(String key,
                                            Set<String> expectedValues,
                                            LoggerAuditingExtension ext,
                                            List<String> expectedPatterns,
                                            String... ignoredPatterns)
        Asserts that the specified key is present in the log events with the expected values.
        Parameters:
        key - the key to look for
        expectedValues - the expected values of the key
        ext - the LoggerAuditingExtension instance
        expectedPatterns - the list of expected patterns
        ignoredPatterns - the array of ignore patterns
      • assertKeyPresent

        public static void assertKeyPresent​(String key,
                                            String expectedValue,
                                            LoggerAuditingExtension ext,
                                            List<String> expectedPatterns,
                                            String... ignoredPatterns)
        Asserts that the specified key is present in the log events with the expected value.
        Parameters:
        key - the key to look for
        expectedValue - the expected value of the key
        ext - the LoggerAuditingExtension instance
        expectedPatterns - the list of expected patterns
        ignoredPatterns - the array of ignore patterns