<commit_before>package com.mpalourdio.springboottemplate.model;

import com.mpalourdio.springboottemplate.AbstractTestRunner;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;

import java.util.List;

@DataJpaTest
public class TaskRepositoryTest extends AbstractTestRunner {

    @Autowired
    private TestEntityManager entityManager;

    @Autowired
    private TaskRepository taskRepository;

    private Task task;
    private People people;

    @Before
    public void setUp() {
        task = new Task();
        task.setTaskArchived(true);
        task.setTaskName("name");
        task.setTaskDescription("description");
        task.setTaskPriority("LOW");
        task.setTaskStatus("ACTIVE");

        people = new People();
        people.setName("john");
        people.setTask(task);
    }

    @Test
    public void testTableIsEmpty() {
        final List<Task> taskList = taskRepository.findAll();
        Assert.assertEquals(0, taskList.size());
    }

    @Test
    public void testAndPlayWithTheFakeentityManager() {
        final Task persistedTask = entityManager.persistFlushFind(task);
        Assert.assertEquals(persistedTask.getTaskDescription(), "description");
    }

    @Test
    public void testResultsAreDummyObjects() {
        entityManager.persistFlushFind(task);
        entityManager.persistFlushFind(people);
        final List<Dummy> dummyList = taskRepository.hydrateDummyObject();

        Assert.assertEquals(1, dummyList.size());
        Assert.assertEquals(true, (dummyList.get(0)) instanceof Dummy);
    }
}
<commit_msg>Use persist instead of persistFlushFind<commit_after>package com.mpalourdio.springboottemplate.model;

import com.mpalourdio.springboottemplate.AbstractTestRunner;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
import org.springframework.boot.test.autoconfigure.orm.jpa.TestEntityManager;

import java.util.List;

@DataJpaTest
public class TaskRepositoryTest extends AbstractTestRunner {

    @Autowired
    private TestEntityManager entityManager;

    @Autowired
    private TaskRepository taskRepository;

    private Task task;
    private People people;

    @Before
    public void setUp() {
        task = new Task();
        task.setTaskArchived(true);
        task.setTaskName("name");
        task.setTaskDescription("description");
        task.setTaskPriority("LOW");
        task.setTaskStatus("ACTIVE");

        people = new People();
        people.setName("john");
        people.setTask(task);
    }

    @Test
    public void testTableIsEmpty() {
        final List<Task> taskList = taskRepository.findAll();
        Assert.assertEquals(0, taskList.size());
    }

    @Test
    public void testAndPlayWithTheFakeentityManager() {
        final Task persistedTask = entityManager.persistFlushFind(task);
        Assert.assertEquals(persistedTask.getTaskDescription(), "description");
    }

    @Test
    public void testResultsAreDummyObjects() {
        entityManager.persist(task);
        entityManager.persist(people);
        final List<Dummy> dummyList = taskRepository.hydrateDummyObject();

        Assert.assertEquals(1, dummyList.size());
        Assert.assertEquals(true, (dummyList.get(0)) instanceof Dummy);
    }
}

{'fraction_non_alphanumeric': 0.10132890365448505, 'fraction_numerical': 0.0016611295681063123, 'mean_word_length': 3.637997432605905, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '261649', 'n_tokens_mistral': 1012, 'n_tokens_neox': 999, 'n_words': 186}