ffaa3ad1293cede228f382b74dfe68daf2e4efb4
[JavaForFun] /
1 package de.spring.example.persistence.repository;
2
3 import javax.inject.Inject;
4
5 import org.junit.ClassRule;
6 import org.junit.Test;
7 import org.junit.runner.RunWith;
8 import org.springframework.test.context.ContextConfiguration;
9 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
10 import org.springframework.transaction.annotation.Transactional;
11
12 import com.palantir.docker.compose.DockerComposeRule;
13 import com.palantir.docker.compose.connection.waiting.HealthChecks;
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         @ClassRule
27     public static final DockerComposeRule DOCKER = DockerComposeRule.builder()
28             .file("src/integTest/resources/docker/docker-compose.yml")
29             .waitingForService("mysql", HealthChecks.toHaveAllPortsOpen())
30             .saveLogsTo("build/dockerLogs")
31             .build();
32         
33         @Test public void
34         find_ad_descriptions_by_ad() {
35                 Iterable<AdDescription> adDescriptions = adDescriptionRepository.findAll();
36                 
37                 Iterable<AdDescription> lol = adDescriptions;
38                 
39         }
40         
41 }