File tree Expand file tree Collapse file tree
test/java/ru/practicum/shareit Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 <artifactId >spring-boot-configuration-processor</artifactId >
3434 <optional >true</optional >
3535 </dependency >
36-
36+ <dependency >
37+ <groupId >com.h2database</groupId >
38+ <artifactId >h2</artifactId >
39+ <scope >runtime</scope >
40+ </dependency >
3741 <dependency >
3842 <groupId >org.postgresql</groupId >
3943 <artifactId >postgresql</artifactId >
4549 <artifactId >lombok</artifactId >
4650 <optional >true</optional >
4751 </dependency >
48-
49- <dependency >
50- <groupId >com.h2database</groupId >
51- <artifactId >h2</artifactId >
52- <scope >test</scope >
53- </dependency >
5452 <dependency >
5553 <groupId >org.springframework.boot</groupId >
5654 <artifactId >spring-boot-starter-test</artifactId >
Original file line number Diff line number Diff line change 1- spring.jpa.hibernate.ddl-auto =none
1+ spring.sql.init.mode =never
2+
3+ spring.datasource.driver-class-name =org.h2.Driver
4+ spring.datasource.url =jdbc:h2:mem:shareit; DB_CLOSE_DELAY=-1;MODE=PostgreSQL
5+ spring.datasource.username =sa
6+ spring.datasource.password =
7+
8+ spring.jpa.hibernate.ddl-auto =create-drop
29spring.jpa.properties.hibernate.format_sql =true
3- spring.sql.init.mode =always
10+ spring.jpa.properties.hibernate.dialect =org.hibernate.dialect.H2Dialect
11+
412logging.level.org.springframework.orm.jpa =INFO
513logging.level.org.springframework.transaction =INFO
614logging.level.org.springframework.transaction.interceptor =TRACE
7- logging.level.org.springframework.orm.jpa.JpaTransactionManager =DEBUG
8-
9- # TODO Append connection to H2 DB
10- # spring.datasource.driverClassName
11- # spring.datasource.url
12- # spring.datasource.username
13- # spring.datasource.password
15+ logging.level.org.springframework.orm.jpa.JpaTransactionManager =DEBUG
Original file line number Diff line number Diff line change 22
33import org .junit .jupiter .api .Test ;
44import org .springframework .boot .test .context .SpringBootTest ;
5+ import org .springframework .test .context .ActiveProfiles ;
56
67@ SpringBootTest
8+ @ ActiveProfiles ("test" )
79class ShareItTests {
8-
910 @ Test
1011 void contextLoads () {
1112 }
12-
1313}
You can’t perform that action at this time.
0 commit comments