Slide 14
Slide 14 text
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Test that repository
14 @snicoll
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = DemoApplication.class)
public class SpeakerRepositoryTest {
@Autowired
private SpeakerRepository speakerRepository;
@Test
public void testFindByTwitter() throws Exception {
Speaker stephane = speakerRepository.save(
new Speaker("Stephane", "Nicoll", "snicoll"));
assertThat(speakerRepository.findByTwitter("snicoll").getId(),
is(stephane.getId()));
}
}