// Path: src/main/java/com/mpalourdio/springboottemplate/model/RepositoriesService.java
// @Service
// public class RepositoriesService {
// 
//     private final EntityManager entityManager;
//     private final PeopleRepository peopleRepository;
//     private final TaskRepository taskRepository;
// 
//     public RepositoriesService(
//             PeopleRepository peopleRepository,
//             TaskRepository taskRepository,
//             EntityManager entityManager) {
//         this.peopleRepository = peopleRepository;
//         this.taskRepository = taskRepository;
//         this.entityManager = entityManager;
//     }
// 
//     @Transactional
//     public List<People> getAllPeople() {
//         return peopleRepository.findAll();
//     }
// 
//     @Transactional
//     public List<Task> getAllTasks() {
//         return taskRepository.findAll();
//     }
// 
//     @Transactional
//     public People useEntityManager() {
//         return entityManager.getReference(People.class, 1);
//     }
// }
// 
// Path: src/main/java/com/mpalourdio/springboottemplate/model/entities/People.java
// @Entity
// @Table(name = "task_people")
// @Getter
// @Setter
// @Accessors(chain = true)
// public class People {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "task_people_people_id_seq")
//     @Column(name = "people_id")
//     private int id;
// 
//     @Column(name = "name", nullable = false)
//     private String name;
// 
//     @ManyToOne
//     @JoinColumn(name = "task_id", nullable = false)
//     private Task task;
// }


import com.mpalourdio.springboottemplate.model.RepositoriesService;
import com.mpalourdio.springboottemplate.model.entities.People;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import javax.persistence.EntityManager;
import static org.junit.jupiter.api.Assertions.assertEquals;
/*
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.mpalourdio.springboottemplate.model.repositories;




@ExtendWith(MockitoExtension.class)
class RepositoriesServiceTest {

    @Mock
    private EntityManager entityManager;

    @Mock
    private PeopleRepository peopleRepository;

    @Mock
    private TaskRepository taskRepository;

    private RepositoriesService repositoriesService;

    @BeforeEach
    void setUp() {
        repositoriesService = new RepositoriesService(
                peopleRepository, taskRepository, entityManager
        );
    }

    @Test
    void testEntityManagerIsMocked() {
        var expectedId = 666;

// Path: src/main/java/com/mpalourdio/springboottemplate/model/RepositoriesService.java
// @Service
// public class RepositoriesService {
// 
//     private final EntityManager entityManager;
//     private final PeopleRepository peopleRepository;
//     private final TaskRepository taskRepository;
// 
//     public RepositoriesService(
//             PeopleRepository peopleRepository,
//             TaskRepository taskRepository,
//             EntityManager entityManager) {
//         this.peopleRepository = peopleRepository;
//         this.taskRepository = taskRepository;
//         this.entityManager = entityManager;
//     }
// 
//     @Transactional
//     public List<People> getAllPeople() {
//         return peopleRepository.findAll();
//     }
// 
//     @Transactional
//     public List<Task> getAllTasks() {
//         return taskRepository.findAll();
//     }
// 
//     @Transactional
//     public People useEntityManager() {
//         return entityManager.getReference(People.class, 1);
//     }
// }
// 
// Path: src/main/java/com/mpalourdio/springboottemplate/model/entities/People.java
// @Entity
// @Table(name = "task_people")
// @Getter
// @Setter
// @Accessors(chain = true)
// public class People {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "task_people_people_id_seq")
//     @Column(name = "people_id")
//     private int id;
// 
//     @Column(name = "name", nullable = false)
//     private String name;
// 
//     @ManyToOne
//     @JoinColumn(name = "task_id", nullable = false)
//     private Task task;
// }


// Path: src/test/java/com/mpalourdio/springboottemplate/model/repositories/RepositoriesServiceTest.java
import com.mpalourdio.springboottemplate.model.RepositoriesService;
import com.mpalourdio.springboottemplate.model.entities.People;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import javax.persistence.EntityManager;
import static org.junit.jupiter.api.Assertions.assertEquals;

/*
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.mpalourdio.springboottemplate.model.repositories;




@ExtendWith(MockitoExtension.class)
class RepositoriesServiceTest {

    @Mock
    private EntityManager entityManager;

    @Mock
    private PeopleRepository peopleRepository;

    @Mock
    private TaskRepository taskRepository;

    private RepositoriesService repositoriesService;

    @BeforeEach
    void setUp() {
        repositoriesService = new RepositoriesService(
                peopleRepository, taskRepository, entityManager
        );
    }

    @Test
    void testEntityManagerIsMocked() {
        var expectedId = 666;

        var people = new People();