package Team5.SmartTownsOld; //import Team5.SmartTowns.Data.Location; //import Team5.SmartTowns.Data.LocationRepositoryJDBC; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; //import org.springframework.jdbc.core.JdbcTemplate; import static org.junit.jupiter.api.Assertions.assertEquals; @SpringJUnitConfig public class Test4 { // @Mock // JdbcTemplate jdbcTemplate; // @BeforeAll // static void before() { // Location location = new Location(); // } @Test public void whenMockJdbcTemplate_thenReturnCorrectEmployeeCount() { // Location aa=new Location(); // LocationRepositoryJDBC employeeDAO = new LocationRepositoryJDBC(); // ReflectionTestUtils.setField(employeeDAO, "jdbcTemplate", jdbcTemplate); // Mockito.when(jdbcTemplate.queryForObject("SELECT COUNT(*) FROM locations", Integer.class)) // .thenReturn(4); assertEquals(4, 4); } }