From 3e41bdf3472811e41185ef52e1c0cf1cc8a74698 Mon Sep 17 00:00:00 2001 From: Vitaliy Fedoriv Date: Wed, 9 Nov 2016 21:40:05 +0200 Subject: [PATCH] add @Qualifier to web package tests --- .../samples/petclinic/web/OwnerControllerTests.java | 2 ++ .../samples/petclinic/web/PetControllerTests.java | 2 ++ .../samples/petclinic/web/PetTypeFormatterTests.java | 2 ++ .../samples/petclinic/web/VetControllerTests.java | 2 ++ .../samples/petclinic/web/VisitControllerTests.java | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/test/java/org/springframework/samples/petclinic/web/OwnerControllerTests.java b/src/test/java/org/springframework/samples/petclinic/web/OwnerControllerTests.java index abf08853e..b539180d6 100644 --- a/src/test/java/org/springframework/samples/petclinic/web/OwnerControllerTests.java +++ b/src/test/java/org/springframework/samples/petclinic/web/OwnerControllerTests.java @@ -5,6 +5,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.samples.petclinic.model.Owner; import org.springframework.samples.petclinic.service.ClinicService; import org.springframework.test.context.ContextConfiguration; @@ -36,6 +37,7 @@ public class OwnerControllerTests { private OwnerController ownerController; @Autowired + @Qualifier("ClinicService") private ClinicService clinicService; private MockMvc mockMvc; diff --git a/src/test/java/org/springframework/samples/petclinic/web/PetControllerTests.java b/src/test/java/org/springframework/samples/petclinic/web/PetControllerTests.java index d87513503..4f9206705 100644 --- a/src/test/java/org/springframework/samples/petclinic/web/PetControllerTests.java +++ b/src/test/java/org/springframework/samples/petclinic/web/PetControllerTests.java @@ -5,6 +5,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.format.support.FormattingConversionServiceFactoryBean; import org.springframework.samples.petclinic.model.Owner; import org.springframework.samples.petclinic.model.Pet; @@ -41,6 +42,7 @@ public class PetControllerTests { private FormattingConversionServiceFactoryBean formattingConversionServiceFactoryBean; @Autowired + @Qualifier("ClinicService") private ClinicService clinicService; private MockMvc mockMvc; diff --git a/src/test/java/org/springframework/samples/petclinic/web/PetTypeFormatterTests.java b/src/test/java/org/springframework/samples/petclinic/web/PetTypeFormatterTests.java index e1b2a53fb..98a9ceb17 100644 --- a/src/test/java/org/springframework/samples/petclinic/web/PetTypeFormatterTests.java +++ b/src/test/java/org/springframework/samples/petclinic/web/PetTypeFormatterTests.java @@ -6,6 +6,7 @@ import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.runners.MockitoJUnitRunner; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.samples.petclinic.model.PetType; import org.springframework.samples.petclinic.service.ClinicService; @@ -23,6 +24,7 @@ import static org.junit.Assert.assertEquals; public class PetTypeFormatterTests { @Mock + @Qualifier("ClinicService") private ClinicService clinicService; private PetTypeFormatter petTypeFormatter; diff --git a/src/test/java/org/springframework/samples/petclinic/web/VetControllerTests.java b/src/test/java/org/springframework/samples/petclinic/web/VetControllerTests.java index b258b8d97..a9b0726c5 100644 --- a/src/test/java/org/springframework/samples/petclinic/web/VetControllerTests.java +++ b/src/test/java/org/springframework/samples/petclinic/web/VetControllerTests.java @@ -5,6 +5,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.MediaType; import org.springframework.samples.petclinic.model.Specialty; import org.springframework.samples.petclinic.model.Vet; @@ -33,6 +34,7 @@ public class VetControllerTests { private VetController vetController; @Autowired + @Qualifier("ClinicService") private ClinicService clinicService; private MockMvc mockMvc; diff --git a/src/test/java/org/springframework/samples/petclinic/web/VisitControllerTests.java b/src/test/java/org/springframework/samples/petclinic/web/VisitControllerTests.java index 25905df3c..0ba2e2c62 100644 --- a/src/test/java/org/springframework/samples/petclinic/web/VisitControllerTests.java +++ b/src/test/java/org/springframework/samples/petclinic/web/VisitControllerTests.java @@ -4,6 +4,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.samples.petclinic.model.Pet; import org.springframework.samples.petclinic.service.ClinicService; import org.springframework.test.context.ContextConfiguration; @@ -33,6 +34,7 @@ public class VisitControllerTests { private VisitController visitController; @Autowired + @Qualifier("ClinicService") private ClinicService clinicService; private MockMvc mockMvc;