<commit_before>package com.github.ambry.rest;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import junit.framework.Assert;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.spi.LoggingEvent;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


public class PublicAccessLoggerTest {
  private Logger publicAccessLogger = LoggerFactory.getLogger("PublicAccessLogger");
  private final String REQUEST_HEADER_PREFIX = "requestHeader";
  private final String RESPONSE_HEADER_PREFIX = "responseHeader";

  @Test
  public void testPublicAccessLoggerHeaders() {
    String[] requestHeaders = new String[]{REQUEST_HEADER_PREFIX + "1", REQUEST_HEADER_PREFIX + "2"};
    String[] responseHeaders = new String[]{RESPONSE_HEADER_PREFIX + "1", RESPONSE_HEADER_PREFIX + "2"};
    PublicAccessLogger publicAccessLogger = new PublicAccessLogger(requestHeaders, responseHeaders);
    Assert.assertTrue("Request Headers mismatch ",
        Arrays.deepEquals(publicAccessLogger.getRequestHeaders(), requestHeaders));
    Assert.assertTrue("Response Headers mismatch ",
        Arrays.deepEquals(publicAccessLogger.getResponseHeaders(), responseHeaders));
  }

  @Test
  public void testPublicAccessLogger() {
    Logger publicAccessLogger = LoggerFactory.getLogger("PublicAccessLogger");
  }

  public static final class MockAppender extends AppenderSkeleton {
    private final List<LoggingEvent> logLines;

    public MockAppender() {
      logLines = new ArrayList<LoggingEvent>();
    }

    @Override
    public void close() {
    }

    @Override
    public boolean requiresLayout() {
      return false;
    }

    @Override
    protected void append(LoggingEvent event) {
      logLines.add(event);
    }

    public List<LoggingEvent> getLogLines() {
      return logLines;
    }
  }
}<commit_msg>Fixing test for PublicAccessLogger<commit_after>package com.github.ambry.rest;

import java.util.Arrays;
import junit.framework.Assert;
import org.junit.Test;


public class PublicAccessLoggerTest {
  private final String REQUEST_HEADER_PREFIX = "requestHeader";
  private final String RESPONSE_HEADER_PREFIX = "responseHeader";

  @Test
  public void testPublicAccessLoggerHeaders() {
    String[] requestHeaders = new String[]{REQUEST_HEADER_PREFIX + "1", REQUEST_HEADER_PREFIX + "2"};
    String[] responseHeaders = new String[]{RESPONSE_HEADER_PREFIX + "1", RESPONSE_HEADER_PREFIX + "2"};
    PublicAccessLogger publicAccessLogger = new PublicAccessLogger(requestHeaders, responseHeaders);
    Assert.assertTrue("Request Headers mismatch ",
        Arrays.deepEquals(publicAccessLogger.getRequestHeaders(), requestHeaders));
    Assert.assertTrue("Response Headers mismatch ",
        Arrays.deepEquals(publicAccessLogger.getResponseHeaders(), responseHeaders));
  }
}
{'fraction_non_alphanumeric': 0.09527170077628794, 'fraction_numerical': 0.004234297812279464, 'mean_word_length': 5.0576923076923075, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2655349', 'n_tokens_mistral': 793, 'n_tokens_neox': 772, 'n_words': 171}