[BAEL-16768] - Fixed the integrations tests in spring-boot-persistence-mongodb

This commit is contained in:
amit2103 2019-08-30 00:53:00 +05:30
parent e8f83431b3
commit f24178a39f
2 changed files with 8 additions and 3 deletions

View File

@ -1,18 +1,21 @@
package com.baeldung.mongodb;
import com.baeldung.mongodb.daos.UserRepository;
import com.baeldung.mongodb.models.User;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
import com.baeldung.mongodb.daos.UserRepository;
import com.baeldung.mongodb.models.User;
@RunWith(SpringRunner.class)
@SpringBootTest
@DirtiesContext
public class MongoDbAutoGeneratedFieldIntegrationTest {
@Autowired

View File

@ -8,6 +8,7 @@ import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
@ -18,6 +19,7 @@ import com.mongodb.DBObject;
@ContextConfiguration(classes = SpringBootPersistenceApplication.class)
@DataMongoTest
@ExtendWith(SpringExtension.class)
@DirtiesContext
public class MongoDbSpringIntegrationTest {
@DisplayName("Given object When save object using MongoDB template Then object can be found")
@Test