Code review comment: If you disable additivity, then the lines are not forwarded to the parent logger. The consequence is that the lines disappear for the user.

Code under review:
protected void before() throws Throwable {
        loggingEvents = new ConcurrentLinkedQueue<>();

        final LoggerConfig previousLoggerConfig =
                LOGGER_CONTEXT.getConfiguration().getLoggerConfig(loggerName);

        final Level previousLevel = previousLoggerConfig.getLevel();
        final Level userDefinedLevel = Level.getLevel(level.name());

        
        
        
        final Level newLevel =
                userDefinedLevel.isMoreSpecificThan(previousLevel)
                        ? previousLevel
                        : userDefinedLevel;

        
        final Filter levelFilter =
                ThresholdFilter.createFilter(
                        userDefinedLevel, Filter.Result.ACCEPT, Filter.Result.DENY);

        Appender testAppender =
                new AbstractAppender(
                        "test-appender-" + generateRandomString(), levelFilter, null, false) {
                    @Override
                    public void append(LogEvent event) {
                        loggingEvents.add(event.getMessage().getFormattedMessage());
                    }
                };
        testAppender.start();

        LoggerConfig loggerConfig =
                LoggerConfig.createLogger(
                        true,
                        newLevel,
                        loggerName,
                        null,
                        new AppenderRef[] {},
                        null,
                        LOGGER_CONTEXT.getConfiguration(),
                        null);
        loggerConfig.addAppender(testAppender, null, null);

        if (previousLoggerConfig.getName().equals(loggerName)) {
            
            backupLoggerConfig = previousLoggerConfig;
            LOGGER_CONTEXT.getConfiguration().removeLogger(loggerName);

            
            
            
            for (Appender appender : previousLoggerConfig.getAppenders().values()) {
                loggerConfig.addAppender(appender, null, null);
            }
        }

        LOGGER_CONTEXT.getConfiguration().addLogger(loggerName, loggerConfig);
        LOGGER_CONTEXT.updateLoggers();
    }

Line commented on: null,

Revised code:
protected void before() throws Throwable {
        loggingEvents = new ConcurrentLinkedQueue<>();

        final LoggerConfig previousLoggerConfig =
                LOGGER_CONTEXT.getConfiguration().getLoggerConfig(loggerName);

        final Level previousLevel = previousLoggerConfig.getLevel();
        final Level userDefinedLevel = Level.getLevel(level.name());

        
        
        
        final Level newLevel =
                userDefinedLevel.isMoreSpecificThan(previousLevel)
                        ? previousLevel
                        : userDefinedLevel;

        
        final Filter levelFilter =
                ThresholdFilter.createFilter(
                        userDefinedLevel, Filter.Result.ACCEPT, Filter.Result.DENY);

        final Appender testAppender =
                new AbstractAppender(
                        "test-appender-" + generateRandomString(), levelFilter, null, false) {
                    @Override
                    public void append(LogEvent event) {
                        loggingEvents.add(event.getMessage().getFormattedMessage());
                    }
                };
        testAppender.start();

        final LoggerConfig loggerConfig =
                LoggerConfig.createLogger(
                        true,
                        newLevel,
                        loggerName,
                        null,
                        new AppenderRef[] {},
                        null,
                        LOGGER_CONTEXT.getConfiguration(),
                        null);
        loggerConfig.addAppender(testAppender, null, null);

        if (previousLoggerConfig.getName().equals(loggerName)) {
            
            backupLoggerConfig = previousLoggerConfig;
            LOGGER_CONTEXT.getConfiguration().removeLogger(loggerName);

            
            
            
            for (Appender appender : previousLoggerConfig.getAppenders().values()) {
                loggerConfig.addAppender(appender, null, null);
            }
        }

        LOGGER_CONTEXT.getConfiguration().addLogger(loggerName, loggerConfig);
        LOGGER_CONTEXT.updateLoggers();
    }