[BAEL-10128] Updated spring JPA article

This commit is contained in:
amit2103
2019-03-11 00:44:59 +05:30
parent 0811b20096
commit d36107b8c0
3 changed files with 7 additions and 5 deletions
@@ -3,6 +3,7 @@ package com.baeldung;
import org.baeldung.config.PersistenceJPAConfigL2Cache;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
@@ -11,6 +12,7 @@ import org.springframework.test.context.web.WebAppConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { PersistenceJPAConfigL2Cache.class }, loader = AnnotationConfigContextLoader.class)
@WebAppConfiguration
@DirtiesContext
public class SpringContextIntegrationTest {
@Test
@@ -35,7 +35,7 @@ public class InMemoryDBIntegrationTest {
Student student = new Student(ID, NAME);
studentRepository.save(student);
Student student2 = studentRepository.findOne(ID);
Student student2 = studentRepository.findById(ID).get();
assertEquals("name incorrect", NAME, student2.getName());
}