<commit_before>package org.sagebionetworks.bridge;

import org.sagebionetworks.bridge.dao.StudyConsentDao;
import org.sagebionetworks.bridge.dynamodb.DynamoStudy;
import org.sagebionetworks.bridge.exceptions.EntityNotFoundException;
import org.sagebionetworks.bridge.models.studies.Study;
import org.sagebionetworks.bridge.models.studies.StudyConsent;
import org.sagebionetworks.bridge.models.studies.StudyIdentifier;
import org.sagebionetworks.bridge.services.StudyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class StudyConsentBootstrapper {
    
    @Autowired
    public StudyConsentBootstrapper(StudyService studyService, StudyConsentDao studyConsentDao) {
        try {
            studyService.getStudy("api");
        } catch(EntityNotFoundException e) {
            Study study = new DynamoStudy();
            study.setName("Test Study");
            study.setIdentifier("api");
            study.setHostname("api-local.sagebridge.org");
            study.setMinAgeOfConsent(18);
            study.setResearcherRole("api_researcher");
            study.setConsentNotificationEmail("<EMAIL>");
            study.setStormpathHref("https://api.stormpath.com/v1/directories/shHutmsq4TcjyJQ5ayMoQ");<commit_msg>FWIW need to update this or the API keys won't work with it<commit_after>package org.sagebionetworks.bridge;

import org.sagebionetworks.bridge.dao.StudyConsentDao;
import org.sagebionetworks.bridge.dynamodb.DynamoStudy;
import org.sagebionetworks.bridge.exceptions.EntityNotFoundException;
import org.sagebionetworks.bridge.models.studies.Study;
import org.sagebionetworks.bridge.models.studies.StudyConsent;
import org.sagebionetworks.bridge.models.studies.StudyIdentifier;
import org.sagebionetworks.bridge.services.StudyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class StudyConsentBootstrapper {
    
    @Autowired
    public StudyConsentBootstrapper(StudyService studyService, StudyConsentDao studyConsentDao) {
        try {
            studyService.getStudy("api");
        } catch(EntityNotFoundException e) {
            Study study = new DynamoStudy();
            study.setName("Test Study");
            study.setIdentifier("api");
            study.setHostname("api-local.sagebridge.org");
            study.setMinAgeOfConsent(18);
            study.setResearcherRole("api_researcher");
            study.setConsentNotificationEmail("<EMAIL>");
            study.setStormpathHref("https://enterprise.stormpath.io/v1/directories/7W9Lyy4h6PhtxVak4DlIWo");
{'fraction_non_alphanumeric': 0.09682242990654205, 'fraction_numerical': 0.00485981308411215, 'mean_word_length': 4.236790606653621, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '2140754', 'n_tokens_mistral': 833, 'n_tokens_neox': 820, 'n_words': 103}