Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.data.mongodb.core.MongoTemplate;
- import org.springframework.data.mongodb.core.query.Criteria;
- import org.springframework.data.mongodb.core.query.Query;
- import org.springframework.test.context.ActiveProfiles;
- import org.springframework.test.context.TestPropertySource;
- import org.springframework.test.context.junit4.SpringRunner;
- @RunWith(SpringRunner.class)
- @SpringBootTest
- @ActiveProfiles(profiles = {"test"})
- public class SampleTest {
- @Autowired
- MongoTemplate mongoTemplate;
- //..... Some Test methods goes here ....
- }
- spring.data.mongodb.uri=mongodb://<test db ip config goes here>/test_app_db
- spring.data.mongodb.uri=mongodb://<dev ip>/app_db
Add Comment
Please, Sign In to add comment