Fixed test @Transient
This commit is contained in:
		
							parent
							
								
									11c364d9cf
								
							
						
					
					
						commit
						67d636aaf9
					
				| @ -2,6 +2,7 @@ package org.baeldung.mongotemplate; | |||||||
| 
 | 
 | ||||||
| import static org.hamcrest.CoreMatchers.is; | import static org.hamcrest.CoreMatchers.is; | ||||||
| import static org.junit.Assert.assertThat; | import static org.junit.Assert.assertThat; | ||||||
|  | import static org.hamcrest.Matchers.nullValue; | ||||||
| 
 | 
 | ||||||
| import java.util.List; | import java.util.List; | ||||||
| 
 | 
 | ||||||
| @ -25,6 +26,7 @@ import org.springframework.data.mongodb.core.query.Query; | |||||||
| import org.springframework.test.context.ContextConfiguration; | import org.springframework.test.context.ContextConfiguration; | ||||||
| import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| @RunWith(SpringJUnit4ClassRunner.class) | @RunWith(SpringJUnit4ClassRunner.class) | ||||||
| @ContextConfiguration(classes = MongoConfig.class) | @ContextConfiguration(classes = MongoConfig.class) | ||||||
| public class MongoTemplateQueryIntegrationTest { | public class MongoTemplateQueryIntegrationTest { | ||||||
| @ -189,6 +191,6 @@ public class MongoTemplateQueryIntegrationTest { | |||||||
|         user.setYearOfBirth(1985); |         user.setYearOfBirth(1985); | ||||||
|         mongoTemplate.insert(user); |         mongoTemplate.insert(user); | ||||||
| 
 | 
 | ||||||
|         assertThat(user.getYearOfBirth(), is(1985)); |         assertThat(mongoTemplate.findOne(Query.query(Criteria.where("name").is("Alex")), User.class).getYearOfBirth(), is(nullValue())); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user