BAEL-905 Improvements in spring boot testing (#1783)
* BAEL-88 Testing in Spring Boot * BAEL-88 Integration tests fixed. * BAEL-905 Improvement task for spring boot testing * BAEL-905 Improvement task for spring boot testing
This commit is contained in:
parent
267b5501da
commit
14f90c8636
|
@ -19,18 +19,19 @@ import org.junit.After;
|
|||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, classes = DemoApplication.class)
|
||||
@AutoConfigureMockMvc
|
||||
@TestPropertySource(locations = "classpath:application-integrationtest.properties")
|
||||
// @TestPropertySource(locations = "classpath:application-integrationtest.properties")
|
||||
@AutoConfigureTestDatabase
|
||||
public class EmployeeRestControllerIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
spring.datasource.url = jdbc:h2:mem:test
|
||||
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.H2Dialect
|
||||
spring.datasource.url=jdbc:mysql://localhost:3306/employee_int_test
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=root
|
||||
|
||||
|
|
Loading…
Reference in New Issue