From 78945431062941c8df909118460a1acfb3408e36 Mon Sep 17 00:00:00 2001 From: Michiel Van Huyck Date: Tue, 20 Sep 2022 22:25:22 +0200 Subject: [PATCH] #9: Spring web config with XML --- .../petclinic/web/OwnerControllerTest.java | 24 +++++++++++++++++++ src/test/resources/spring/mvc-test-config.xml | 12 ++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/test/java/org/springframework/samples/petclinic/web/OwnerControllerTest.java create mode 100644 src/test/resources/spring/mvc-test-config.xml diff --git a/src/test/java/org/springframework/samples/petclinic/web/OwnerControllerTest.java b/src/test/java/org/springframework/samples/petclinic/web/OwnerControllerTest.java new file mode 100644 index 00000000..a1d5474d --- /dev/null +++ b/src/test/java/org/springframework/samples/petclinic/web/OwnerControllerTest.java @@ -0,0 +1,24 @@ +package org.springframework.samples.petclinic.web; + +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.samples.petclinic.service.ClinicService; +import org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig; + +@SpringJUnitWebConfig(locations = {"classpath:spring/mvc-test-config.xml", "classpath:spring/mvc-core-config.xml"}) +class OwnerControllerTest { + + @Autowired + OwnerController ownerController; + + //autowired fromù XML bean mvc-test-config.xml + @Autowired + ClinicService clinicService; + + + @Test + void tempTest() { + + //ownerController + } +} \ No newline at end of file diff --git a/src/test/resources/spring/mvc-test-config.xml b/src/test/resources/spring/mvc-test-config.xml new file mode 100644 index 00000000..ab3b93bc --- /dev/null +++ b/src/test/resources/spring/mvc-test-config.xml @@ -0,0 +1,12 @@ + + + + + + + + +