BAEL-16977 Week 38 | go through the integration test results and see what NEW failing tests we have (#7837)

- Minor fixes for integration tests
This commit is contained in:
Dhawal Kapil 2019-09-23 19:45:10 +05:30 committed by Eugen
parent 6073d2d451
commit 7da66ebd84
3 changed files with 16 additions and 6 deletions

View File

@ -0,0 +1,2 @@
spring.datasource.url=jdbc:h2:tcp:~/jooq;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE
spring.jpa.hibernate.ddl-auto=update

View File

@ -1,18 +1,22 @@
package com.baeldung.example;
import com.baeldung.junit.tags.example.Employee;
import com.baeldung.junit.tags.example.EmployeeDAO;
import com.baeldung.junit.tags.example.SpringJdbcConfig;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
import com.baeldung.junit.tags.example.Employee;
import com.baeldung.junit.tags.example.EmployeeDAO;
import com.baeldung.junit.tags.example.SpringJdbcConfig;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringJdbcConfig.class }, loader = AnnotationConfigContextLoader.class)
@DirtiesContext(classMode = ClassMode.BEFORE_EACH_TEST_METHOD)
public class EmployeeDAOIntegrationTest {
@Autowired

View File

@ -1,8 +1,5 @@
package com.baeldung.tags;
import com.baeldung.junit.tags.example.Employee;
import com.baeldung.junit.tags.example.EmployeeDAO;
import com.baeldung.junit.tags.example.SpringJdbcConfig;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
@ -13,12 +10,19 @@ import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
import com.baeldung.junit.tags.example.Employee;
import com.baeldung.junit.tags.example.EmployeeDAO;
import com.baeldung.junit.tags.example.SpringJdbcConfig;
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = { SpringJdbcConfig.class }, loader = AnnotationConfigContextLoader.class)
@DirtiesContext(classMode = ClassMode.BEFORE_EACH_TEST_METHOD)
public class EmployeeDAOIntegrationTest {
@Autowired