<commit_before>package org.gbif.checklistbank.nub.source;

import org.gbif.api.vocabulary.Rank;
import org.gbif.checklistbank.nub.model.SrcUsage;

import java.util.List;
import java.util.UUID;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class ClasspathUsageSourceTest {

  /**
   * integration test with prod registry
   * @throws Exception
   */
  @Test
  public void testListSources() throws Exception {
    ClasspathUsageSource src = ClasspathUsageSource.allSources();
    List<NubSource> sources = src.listSources();
    assertEquals(3, sources.size());
    assertEquals(1, sources.get(0).priority);
    assertEquals(Rank.FAMILY, sources.get(0).ignoreRanksAbove);
  }

  @Test
  public void testIterateSource() throws Exception {
    ClasspathUsageSource src = ClasspathUsageSource.emptySource();
    NubSource fungi = new NubSource();
    fungi.name = "squirrels";
    fungi.key = UUID.fromString("d7dddbf4-2cf0-4f39-9b2a-99b0e2c3aa01");
    fungi.ignoreRanksAbove = Rank.SPECIES;
    int counter = 0;
    for (SrcUsage u : src.iterateSource(fungi)) {
      counter++;
      System.out.print(u.key + "  ");
      System.out.println(u.scientificName);
    }
    assertEquals(9, counter);
  }
}<commit_msg>Adjust test outcome to new nub source numbers<commit_after>package org.gbif.checklistbank.nub.source;

import org.gbif.api.vocabulary.Rank;
import org.gbif.checklistbank.nub.model.SrcUsage;

import java.util.List;
import java.util.UUID;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class ClasspathUsageSourceTest {

  /**
   * integration test with prod registry
   * @throws Exception
   */
  @Test
  public void testListSources() throws Exception {
    ClasspathUsageSource src = ClasspathUsageSource.allSources();
    List<NubSource> sources = src.listSources();
    assertEquals(8, sources.size());
    assertEquals(1, sources.get(0).priority);
    assertEquals(Rank.FAMILY, sources.get(0).ignoreRanksAbove);
  }

  @Test
  public void testIterateSource() throws Exception {
    ClasspathUsageSource src = ClasspathUsageSource.emptySource();
    NubSource fungi = new NubSource();
    fungi.name = "squirrels";
    fungi.key = UUID.fromString("d7dddbf4-2cf0-4f39-9b2a-99b0e2c3aa01");
    fungi.ignoreRanksAbove = Rank.SPECIES;
    int counter = 0;
    for (SrcUsage u : src.iterateSource(fungi)) {
      counter++;
      System.out.print(u.key + "  ");
      System.out.println(u.scientificName);
    }
    assertEquals(9, counter);
  }
}
{'fraction_non_alphanumeric': 0.11914217633042097, 'fraction_numerical': 0.017474185861795076, 'mean_word_length': 3.93921568627451, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '684888', 'n_tokens_mistral': 853, 'n_tokens_neox': 831, 'n_words': 155}