<commit_before>package dk.statsbibliokeket.newspaper.batcheventFramework;

import dk.statsbiblioteket.newspaper.batcheventFramework.DomsEventClient;
import dk.statsbiblioteket.newspaper.batcheventFramework.DomsEventClientFactory;
import dk.statsbiblioteket.newspaper.processmonitor.datasources.Batch;
import dk.statsbiblioteket.newspaper.processmonitor.datasources.EventID;
import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Properties;

public class SBOIClientImplTest {

    //TODO fix for new summa field names
    @Test(groups = "integrationTest",enabled = true)
    public void testGetBatches() throws Exception {

        Properties props = new Properties();
        props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("ITtest.properties"));

        DomsEventClientFactory factory = new DomsEventClientFactory();
        factory.setFedoraLocation(props.getProperty("fedora.location"));
        factory.setUsername(props.getProperty("fedora.username"));
        factory.setPassword(<PASSWORD>("<PASSWORD>"));
        factory.setPidGeneratorLocation(props.getProperty("pidgenerator.location"));


        DomsEventClient doms = factory.createDomsEventClient();

        SBOIClientImpl summa = new SBOIClientImpl(props.getProperty("sboi.summa"));
        Iterator<Batch> batches = summa.getBatches(
                Arrays.asList(EventID.Data_Received),
                new ArrayList<EventID>(),
                Arrays.asList(EventID.Data_Archived));
        int count = 0;
        while (batches.hasNext()) {<commit_msg>This should fix the test<commit_after>package dk.statsbibliokeket.newspaper.batcheventFramework;

import dk.statsbiblioteket.newspaper.batcheventFramework.DomsEventClient;
import dk.statsbiblioteket.newspaper.batcheventFramework.DomsEventClientFactory;
import dk.statsbiblioteket.newspaper.processmonitor.datasources.Batch;
import dk.statsbiblioteket.newspaper.processmonitor.datasources.EventID;
import org.testng.Assert;
import org.testng.annotations.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Properties;

public class SBOIClientImplTest {

    @Test(groups = "integrationTest",enabled = true)
    public void testGetBatches() throws Exception {

        Properties props = new Properties();
        props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("ITtest.properties"));

        DomsEventClientFactory factory = new DomsEventClientFactory();
        factory.setFedoraLocation(props.getProperty("fedora.location"));
        factory.setUsername(props.getProperty("fedora.username"));
        factory.setPassword(<PASSWORD>("<PASSWORD>"));
        factory.setPidGeneratorLocation(props.getProperty("pidgenerator.location"));


        DomsEventClient doms = factory.createDomsEventClient();

        SBOIClientImpl summa = new SBOIClientImpl(props.getProperty("sboi.summa"));
        Iterator<Batch> batches = summa.getBatches(
                Arrays.asList(EventID.Data_Received),
                new ArrayList<EventID>(),
                Arrays.asList(EventID.Approved));
        int count = 0;
        while (batches.hasNext()) {
{'fraction_non_alphanumeric': 0.10417301248857752, 'fraction_numerical': 0.0006091989034419738, 'mean_word_length': 4.419141914191419, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2283033', 'n_tokens_mistral': 967, 'n_tokens_neox': 944, 'n_words': 141}