Enable transaction management for JdbcOperationsSessionRepository operations
This commit is contained in:
@@ -46,6 +46,7 @@ import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -114,6 +115,15 @@ public class JdbcOperationsSessionRepositoryITests {
|
||||
assertThat(this.repository.getSession(toSave.getId())).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional(readOnly = true)
|
||||
public void savesInReadOnlyTransaction() {
|
||||
JdbcOperationsSessionRepository.JdbcSession toSave = this.repository
|
||||
.createSession();
|
||||
|
||||
this.repository.save(toSave);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void putAllOnSingleAttrDoesNotRemoveOld() {
|
||||
JdbcOperationsSessionRepository.JdbcSession toSave = this.repository
|
||||
|
||||
Reference in New Issue
Block a user