Guest User

Untitled

a guest
Mar 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import org.junit.Test;
  2. import org.junit.runner.RunWith;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.boot.test.context.SpringBootTest;
  5. import org.springframework.data.mongodb.core.MongoTemplate;
  6. import org.springframework.data.mongodb.core.query.Criteria;
  7. import org.springframework.data.mongodb.core.query.Query;
  8. import org.springframework.test.context.ActiveProfiles;
  9. import org.springframework.test.context.TestPropertySource;
  10. import org.springframework.test.context.junit4.SpringRunner;
  11. @RunWith(SpringRunner.class)
  12. @SpringBootTest
  13. @ActiveProfiles(profiles = {"test"})
  14. public class SampleTest {
  15. @Autowired
  16. MongoTemplate mongoTemplate;
  17.  
  18.  
  19. //..... Some Test methods goes here ....
  20.  
  21. }
  22.  
  23. spring.data.mongodb.uri=mongodb://<test db ip config goes here>/test_app_db
  24.  
  25. spring.data.mongodb.uri=mongodb://<dev ip>/app_db
Add Comment
Please, Sign In to add comment