<commit_before>package edu.psu.sweng500.emrms.services;

import edu.psu.sweng500.emrms.model.HEncounter;
import edu.psu.sweng500.emrms.model.HPatient;
import edu.psu.sweng500.emrms.service.SaveEncounterService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;

@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:/spring/emrms-context.xml"})
public class SaveEncounterServiceTest {
    @Autowired
    @Qualifier("saveEncounterService")
    private SaveEncounterService service;

    @Before
    public void setUp() {
        verifySpringAnnotations();
    }

    @After
    public void tearDown() {
        //ToDO
        //delete from h_encounter where HEncounterID = 1001;
    }

    public void verifySpringAnnotations() {
        assertThat(service, instanceOf(SaveEncounterService.class));
    }

    @Test
    public void testSaveEncounter() {
        HPatient hPatient = new HPatient();
        HEncounter hEncounter = new HEncounter();
        hEncounter.sethEncounterID(1001);
        hEncounter.setUserID("admin");
        hEncounter.setCreationDateTime("2017-09-23 21:55:00");
        hEncounter.setEncStartDateTime("2017-09-14 11:55:00");
        hEncounter.setEncStatus(1);
        hEncounter.setEncLocationName("Exton Clinic");
        hEncounter.setEncounterType("OP");<commit_msg>Change made to fix issue with auto incrementing the HEncounterId.<commit_after>package edu.psu.sweng500.emrms.services;

import edu.psu.sweng500.emrms.model.HEncounter;
import edu.psu.sweng500.emrms.model.HPatient;
import edu.psu.sweng500.emrms.service.SaveEncounterService;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import static org.hamcrest.CoreMatchers.instanceOf;
import static org.junit.Assert.assertThat;

@WebAppConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:/spring/emrms-context.xml"})
public class SaveEncounterServiceTest {
    @Autowired
    @Qualifier("saveEncounterService")
    private SaveEncounterService service;

    @Before
    public void setUp() {
        verifySpringAnnotations();
    }

    @After
    public void tearDown() {
        //ToDO
        //delete from h_encounter where HEncounterID = 1001;
    }

    public void verifySpringAnnotations() {
        assertThat(service, instanceOf(SaveEncounterService.class));
    }

    @Test
    public void testSaveEncounter() {
        HPatient hPatient = new HPatient();
        HEncounter hEncounter = new HEncounter();
        //hEncounter.sethEncounterID(1002);
        hEncounter.setUserID("admin");
        hEncounter.setCreationDateTime("2017-09-23 21:55:00");
        hEncounter.setEncStartDateTime("2017-09-14 11:55:00");
        hEncounter.setEncStatus(1);
        hEncounter.setEncLocationName("Exton Clinic");
        hEncounter.setEncounterType("OP");
{'fraction_non_alphanumeric': 0.1032345013477089, 'fraction_numerical': 0.028032345013477088, 'mean_word_length': 4.354978354978355, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3875116', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1114, 'n_words': 182}