mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
add @Qualifier to web package tests
This commit is contained in:
parent
d2ed818034
commit
3e41bdf347
5 changed files with 10 additions and 0 deletions
|
@ -5,6 +5,7 @@ import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.model.Owner;
|
||||||
import org.springframework.samples.petclinic.service.ClinicService;
|
import org.springframework.samples.petclinic.service.ClinicService;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
|
@ -36,6 +37,7 @@ public class OwnerControllerTests {
|
||||||
private OwnerController ownerController;
|
private OwnerController ownerController;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier("ClinicService")
|
||||||
private ClinicService clinicService;
|
private ClinicService clinicService;
|
||||||
|
|
||||||
private MockMvc mockMvc;
|
private MockMvc mockMvc;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.format.support.FormattingConversionServiceFactoryBean;
|
import org.springframework.format.support.FormattingConversionServiceFactoryBean;
|
||||||
import org.springframework.samples.petclinic.model.Owner;
|
import org.springframework.samples.petclinic.model.Owner;
|
||||||
import org.springframework.samples.petclinic.model.Pet;
|
import org.springframework.samples.petclinic.model.Pet;
|
||||||
|
@ -41,6 +42,7 @@ public class PetControllerTests {
|
||||||
private FormattingConversionServiceFactoryBean formattingConversionServiceFactoryBean;
|
private FormattingConversionServiceFactoryBean formattingConversionServiceFactoryBean;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier("ClinicService")
|
||||||
private ClinicService clinicService;
|
private ClinicService clinicService;
|
||||||
|
|
||||||
private MockMvc mockMvc;
|
private MockMvc mockMvc;
|
||||||
|
|
|
@ -6,6 +6,7 @@ import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
import org.mockito.Mockito;
|
import org.mockito.Mockito;
|
||||||
import org.mockito.runners.MockitoJUnitRunner;
|
import org.mockito.runners.MockitoJUnitRunner;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.samples.petclinic.model.PetType;
|
import org.springframework.samples.petclinic.model.PetType;
|
||||||
import org.springframework.samples.petclinic.service.ClinicService;
|
import org.springframework.samples.petclinic.service.ClinicService;
|
||||||
|
|
||||||
|
@ -23,6 +24,7 @@ import static org.junit.Assert.assertEquals;
|
||||||
public class PetTypeFormatterTests {
|
public class PetTypeFormatterTests {
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
|
@Qualifier("ClinicService")
|
||||||
private ClinicService clinicService;
|
private ClinicService clinicService;
|
||||||
|
|
||||||
private PetTypeFormatter petTypeFormatter;
|
private PetTypeFormatter petTypeFormatter;
|
||||||
|
|
|
@ -5,6 +5,7 @@ import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.samples.petclinic.model.Specialty;
|
import org.springframework.samples.petclinic.model.Specialty;
|
||||||
import org.springframework.samples.petclinic.model.Vet;
|
import org.springframework.samples.petclinic.model.Vet;
|
||||||
|
@ -33,6 +34,7 @@ public class VetControllerTests {
|
||||||
private VetController vetController;
|
private VetController vetController;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier("ClinicService")
|
||||||
private ClinicService clinicService;
|
private ClinicService clinicService;
|
||||||
|
|
||||||
private MockMvc mockMvc;
|
private MockMvc mockMvc;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
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.model.Pet;
|
||||||
import org.springframework.samples.petclinic.service.ClinicService;
|
import org.springframework.samples.petclinic.service.ClinicService;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
|
@ -33,6 +34,7 @@ public class VisitControllerTests {
|
||||||
private VisitController visitController;
|
private VisitController visitController;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@Qualifier("ClinicService")
|
||||||
private ClinicService clinicService;
|
private ClinicService clinicService;
|
||||||
|
|
||||||
private MockMvc mockMvc;
|
private MockMvc mockMvc;
|
||||||
|
|
Loading…
Reference in a new issue