Skip to content
Snippets Groups Projects
Commit 518c6b09 authored by Rhys Evans's avatar Rhys Evans
Browse files

Commiting to cehckout main

parent 7587d180
No related branches found
No related tags found
1 merge request!34Resolve "As a user, I would like a town specific page which shows all trails for that town so that I can easily see my progress"
......@@ -36,9 +36,7 @@ dependencies {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-validation'
// https://mvnrepository.com/artifact/org.springframework/spring-dao
// https://mvnrepository.com/artifact/org.springframework/spring-dao
implementation group: 'org.springframework', name: 'spring-tx', version: '6.1.1'
implementation 'org.springframework:spring-dao:2.0.8'
// implementation group: 'org.springframework', name: 'spring-tx', version: '6.1.1'
implementation 'org.springframework:spring-dao:2.0.8'
// implementation 'org.springframework.dao.DataAccessException'
// https://mvnrepository.com/artifact/org.springframework/spring-core
......
package Team5.SmartTowns;
//import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.testng.annotations.Test;
import org.junit.jupiter.api.Test;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.testng.annotations.Test;
//import org.testng.annotations.Test;
//import org.apiguardian.api;
//import org.junit.platform.engine.TestDescriptor;
//import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.testng.AssertJUnit.assertEquals;
......
package Team5.SmartTowns;
import Team5.SmartTowns.Data.locationRepositoryJDBC;
//import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.jdbc.Sql;
import org.testng.annotations.Test;
//import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.testng.Assert.assertEquals;
@SpringBootTest
@JdbcTest
@Sql({"schema.sql", "data.sql"})
public class Test5 {
@Autowired
private JdbcTemplate ajdbc;
@Test
// test 1
void whenInjectInMemoryDataSource_thenReturnCorrectEmployeeCount() {
locationRepositoryJDBC employeeDAO = new locationRepositoryJDBC(ajdbc);
// employeeDAO.setJdbc(ajdbc);
assertEquals(4, employeeDAO.getAllLocation().size());
}
}
//package Team5.SmartTowns;
//
//import Team5.SmartTowns.Data.locationRepositoryJDBC;
////import org.junit.jupiter.api.Test;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.test.autoconfigure.jdbc.JdbcTest;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.jdbc.core.JdbcTemplate;
//import org.springframework.test.context.jdbc.Sql;
//import org.testng.annotations.Test;
//
////import static org.junit.jupiter.api.Assertions.assertEquals;
//import static org.testng.Assert.assertEquals;
//
//@SpringBootTest
//@JdbcTest
//
//@Sql({"schema.sql", "data.sql"})
//public class Test5 {
//
// @Autowired
// private JdbcTemplate ajdbc;
//
//
// @Test
//// test 1
// void whenInjectInMemoryDataSource_thenReturnCorrectEmployeeCount() {
// locationRepositoryJDBC employeeDAO = new locationRepositoryJDBC(ajdbc);
//// employeeDAO.setJdbc(ajdbc);
// assertEquals(4, employeeDAO.getAllLocation().size());
//
// }
//
//
//
//}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment