081704fed081c1f4381f5feff9e1f5dfe5e133ae
[JavaForFun] /
1 package de.spring.example.persistence.repository;
2
3 import static org.hamcrest.CoreMatchers.is;
4 import static org.hamcrest.CoreMatchers.notNullValue;
5 import static org.junit.Assert.assertThat;
6
7 import javax.inject.Inject;
8
9 import org.junit.Test;
10 import org.junit.runner.RunWith;
11 import org.springframework.test.context.ContextConfiguration;
12 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
13 import org.springframework.transaction.annotation.Transactional;
14
15 import de.spring.example.persistence.domain.AdDescription;
16
17 @RunWith(SpringJUnit4ClassRunner.class)
18 @ContextConfiguration( {"classpath*:spring-configuration/*.xml",
19         "classpath*:spring-configuration-docker-test/*.xml"} )
20 @Transactional
21 public class AdDescriptionRepositoryShould {
22         
23         @Inject
24         AdDescriptionRepository adDescriptionRepository;
25         
26         @Test public void
27         find_ad_descriptions_by_ad() {
28                 Iterable<AdDescription> adDescriptions = adDescriptionRepository.findAll();
29                 
30                 for (AdDescription adDescription : adDescriptions) {
31                         assertThat(adDescription, is(notNullValue()));
32                 }
33         }
34         
35 }