@Test public void testSetDefault() { recreateVersions(); assertThat(versionRepository.findDefault(docId).getNo(), is(3)); versionRepository.updateDefaultNo(docId, 4, userId); Version version = versionRepository.findDefault(docId); assertNotNull(version); assertThat(version.getDocId(), is(docId)); assertThat(version.getNo(), is(4)); assertThat(version.getModifiedBy(), equalTo(userRepository.findOne(userId))); }
@Test public void testFindDefaultVersion() { recreateVersions(); Version version = versionRepository.findDefault(docId); assertNotNull(version); assertThat(version.getDocId(), is(docId)); assertThat(version.getNo(), is(3)); }