<commit_before>package edu.northwestern.bioinformatics.studycalendar.test.restfulapi;

import edu.northwestern.bioinformatics.studycalendar.tools.MapBuilder;
import edu.northwestern.bioinformatics.studycalendar.test.integrated.IntegratedTestDatabaseInitializer;
import edu.northwestern.bioinformatics.studycalendar.test.integrated.RowPreservingInitializer;
import edu.northwestern.bioinformatics.studycalendar.test.integrated.SchemaInitializer;
import gov.nih.nci.cabig.ctms.audit.domain.DataAuditInfo;
import org.springframework.beans.factory.annotation.Required;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Date;

/**
 * @author <NAME>
 */
public class RestfulApiTestInitializer extends IntegratedTestDatabaseInitializer {
    private static final Collection<String> NO_INITIALIZER_TABLES = Arrays.asList(
        "authentication_system_conf", "bering_version", "change_actions", "delta_node_types");
    private static final Map<String, List<String>> ALTERNATE_PK_TABLES
        = new MapBuilder<String, List<String>>().
            put("csm_user_pe", Arrays.asList("user_protection_element_id")).
            put("scheduled_activity_labels", Arrays.asList("scheduled_activity_id", "label")).
            put("subject_populations", Arrays.asList("assignment_id", "population_id")).
            put("user_role_study_sites", Arrays.asList("user_role_id", "study_site_id")).
            put("osgi_cm_property_values", Arrays.asList("property_id", "list_index")).
            toMap();

    private SitesInitializer sitesInitializer;
    private ConfigurationInitializer configurationInitializer;
    private UsersInitializer usersInitializer;
    private SampleActivitySourceInitializer sampleSourceInitializer;

    @Override
    public void oneTimeSetup() {
        initAuditInfo();
        super.oneTimeSetup();
    }

    @Override
    public void beforeAll() {
        initAuditInfo();
        super.beforeAll();
    }

    private void initAuditInfo() {
        DataAuditInfo.setLocal(new DataAuditInfo("restful-api-test", "none", new Date(), "[console]"));
    }<commit_msg>Add newly no-PK managing_sites table to explicitly configured list.  #1080.<commit_after>package edu.northwestern.bioinformatics.studycalendar.test.restfulapi;

import edu.northwestern.bioinformatics.studycalendar.tools.MapBuilder;
import edu.northwestern.bioinformatics.studycalendar.test.integrated.IntegratedTestDatabaseInitializer;
import edu.northwestern.bioinformatics.studycalendar.test.integrated.RowPreservingInitializer;
import edu.northwestern.bioinformatics.studycalendar.test.integrated.SchemaInitializer;
import gov.nih.nci.cabig.ctms.audit.domain.DataAuditInfo;
import org.springframework.beans.factory.annotation.Required;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Date;

/**
 * @author <NAME>
 */
public class RestfulApiTestInitializer extends IntegratedTestDatabaseInitializer {
    private static final Collection<String> NO_INITIALIZER_TABLES = Arrays.asList(
        "authentication_system_conf", "bering_version", "change_actions", "delta_node_types");
    private static final Map<String, List<String>> ALTERNATE_PK_TABLES
        = new MapBuilder<String, List<String>>().
            put("csm_user_pe", Arrays.asList("user_protection_element_id")).
            put("scheduled_activity_labels", Arrays.asList("scheduled_activity_id", "label")).
            put("subject_populations", Arrays.asList("assignment_id", "population_id")).
            put("user_role_study_sites", Arrays.asList("user_role_id", "study_site_id")).
            put("osgi_cm_property_values", Arrays.asList("property_id", "list_index")).
            put("managing_sites", Arrays.asList("study_id", "site_id")).
            toMap();

    private SitesInitializer sitesInitializer;
    private ConfigurationInitializer configurationInitializer;
    private UsersInitializer usersInitializer;
    private SampleActivitySourceInitializer sampleSourceInitializer;

    @Override
    public void oneTimeSetup() {
        initAuditInfo();
        super.oneTimeSetup();
    }

    @Override
    public void beforeAll() {
        initAuditInfo();
        super.beforeAll();
    }

    private void initAuditInfo() {
        DataAuditInfo.setLocal(new DataAuditInfo("restful-api-test", "none", new Date(), "[console]"));
    }
{'fraction_non_alphanumeric': 0.10763341589732042, 'fraction_numerical': 0.0009006980409817609, 'mean_word_length': 4.7464424320827945, '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': '2150564', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1262, 'n_words': 208}