Blame view

src/test/java/fr/plil/sio/examen/AnimalServiceTest.java 895 Bytes
589e1ad3   jcartign   First version
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  package fr.plil.sio.examen;

  

  import fr.plil.sio.examen.api.Owner;

  import fr.plil.sio.examen.services.AnimalService;

  import fr.plil.sio.examen.services.OwnerService;

  import org.junit.Test;

  import org.junit.runner.RunWith;

  import org.springframework.beans.factory.annotation.Autowired;

  import org.springframework.boot.test.context.SpringBootTest;

  import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

  import org.springframework.transaction.annotation.Transactional;

  

  @RunWith(SpringJUnit4ClassRunner.class)

  @SpringBootTest

  @Transactional

  public class AnimalServiceTest {

      

      @Autowired

      private AnimalService animalService;

  

      @Autowired

      private OwnerService ownerService;

      

      @Test

      public void createAnimalAndOwner() {

          Owner o = ownerService.create("owner");

          animalService.create("animal", o);        

      }

  }