<commit_before>package com.google.pubsub.flic.output;

import com.google.pubsub.flic.controllers.Client.ClientType;
import com.google.pubsub.flic.controllers.ClientParams;
import com.google.pubsub.flic.controllers.Controller;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/*
 * Tests for {@link SheetsService}.
 */
public class SheetsServiceTest {
  
  @Test
  public void testClientSwitch() {
    Map<String, Map<ClientParams, Integer>> types = 
        new HashMap<String, Map<ClientParams, Integer>>();
    int expectedCpsCount = 0;
    int expectedKafkaCount = 0;
    Map<ClientParams, Integer> paramsMap = new HashMap<ClientParams, Integer>();    
    for (ClientType type : ClientType.values()) {
      paramsMap.put(new ClientParams(type, ""), 1);
      if (type.toString().startsWith("cps")) {
        expectedCpsCount++;
      } else if (type.toString().startsWith("kafka")) {
        expectedKafkaCount++;
      } else {
        fail("ClientType toString didn't start with cps or kafka");
      }
    }
    types.put("zone-test", paramsMap);
    SheetsService service = new SheetsService("", types);
    
    assertEquals(
        service.getCpsPublisherCount() + service.getCpsSubscriberCount(), expectedCpsCount);<commit_msg>Made change to null to avoid test attempting to authorize sheet<commit_after>package com.google.pubsub.flic.output;

import com.google.pubsub.flic.controllers.Client.ClientType;
import com.google.pubsub.flic.controllers.ClientParams;
import com.google.pubsub.flic.controllers.Controller;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

/*
 * Tests for {@link SheetsService}.
 */
public class SheetsServiceTest {
  
  @Test
  public void testClientSwitch() {
    Map<String, Map<ClientParams, Integer>> types = 
        new HashMap<String, Map<ClientParams, Integer>>();
    int expectedCpsCount = 0;
    int expectedKafkaCount = 0;
    Map<ClientParams, Integer> paramsMap = new HashMap<ClientParams, Integer>();    
    for (ClientType type : ClientType.values()) {
      paramsMap.put(new ClientParams(type, ""), 1);
      if (type.toString().startsWith("cps")) {
        expectedCpsCount++;
      } else if (type.toString().startsWith("kafka")) {
        expectedKafkaCount++;
      } else {
        fail("ClientType toString didn't start with cps or kafka");
      }
    }
    types.put("zone-test", paramsMap);
    SheetsService service = new SheetsService(null, types);
    
    assertEquals(
        service.getCpsPublisherCount() + service.getCpsSubscriberCount(), expectedCpsCount);
{'fraction_non_alphanumeric': 0.12226148409893993, 'fraction_numerical': 0.0021201413427561835, 'mean_word_length': 3.8894645941278068, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '834393', 'n_tokens_mistral': 840, 'n_tokens_neox': 831, 'n_words': 185}