From e23d7f8efb72c694509d3f05c6114bce2b784ba7 Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Sun, 9 Aug 2020 18:46:32 +0100 Subject: [PATCH 01/10] BAEL-4321 demo app for yaml to pojo --- configuration/yaml-to-pojo/README.md | 9 ++++ configuration/yaml-to-pojo/pom.xml | 54 +++++++++++++++++++ .../java/yamltopojo/demo/DemoApplication.java | 16 ++++++ .../demo/config/TshirtSizeConfig.java | 27 ++++++++++ .../demo/controller/TshirtSizeController.java | 22 ++++++++ .../demo/service/SizeConverterImpl.java | 22 ++++++++ .../demo/service/SizeConverterService.java | 8 +++ .../src/main/resources/application.yml | 30 +++++++++++ .../yamltopojo/demo/DemoApplicationTests.java | 13 +++++ .../controller/TshirtSizeControllerTest.java | 38 +++++++++++++ 10 files changed, 239 insertions(+) create mode 100644 configuration/yaml-to-pojo/README.md create mode 100644 configuration/yaml-to-pojo/pom.xml create mode 100644 configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/DemoApplication.java create mode 100644 configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java create mode 100644 configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java create mode 100644 configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java create mode 100644 configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterService.java create mode 100644 configuration/yaml-to-pojo/src/main/resources/application.yml create mode 100644 configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/DemoApplicationTests.java create mode 100644 configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java diff --git a/configuration/yaml-to-pojo/README.md b/configuration/yaml-to-pojo/README.md new file mode 100644 index 0000000000..9dba74a7e5 --- /dev/null +++ b/configuration/yaml-to-pojo/README.md @@ -0,0 +1,9 @@ +This is a demo application for using YAML configuration for defining values in a POJO class. + +The application has an endpoint to provide T-shirt size conversion for label and countrycode. + +If you run this service locally you can call this endpoint on: + +`localhost:8080/convertSize?label=M&countryCode=fr` + +It should return the size as int. \ No newline at end of file diff --git a/configuration/yaml-to-pojo/pom.xml b/configuration/yaml-to-pojo/pom.xml new file mode 100644 index 0000000000..f6b55718be --- /dev/null +++ b/configuration/yaml-to-pojo/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.3.2.RELEASE + + + yaml-to-pojo + demo + 0.0.1-SNAPSHOT + demo + Demo project for YAML into POJO + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.springframework.boot + spring-boot-starter-web + RELEASE + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/DemoApplication.java b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/DemoApplication.java new file mode 100644 index 0000000000..ec8df793c2 --- /dev/null +++ b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/DemoApplication.java @@ -0,0 +1,16 @@ +package yamltopojo.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import yamltopojo.demo.config.TshirtSizeConfig; + +@SpringBootApplication +@EnableConfigurationProperties(TshirtSizeConfig.class) +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java new file mode 100644 index 0000000000..8f8d2e5b39 --- /dev/null +++ b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java @@ -0,0 +1,27 @@ +package yamltopojo.demo.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +import java.util.Map; + +@ConfigurationProperties(prefix = "t-shirt-size") +public class TshirtSizeConfig { + + private final Map simpleMapping; + + private final Map> complexMapping; + + + public TshirtSizeConfig(Map simpleMapping, Map> complexMapping) { + this.simpleMapping = simpleMapping; + this.complexMapping = complexMapping; + } + + public Map getSimpleMapping() { + return simpleMapping; + } + + public Map> getComplexMapping() { + return complexMapping; + } +} diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java new file mode 100644 index 0000000000..d555549bd4 --- /dev/null +++ b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java @@ -0,0 +1,22 @@ +package yamltopojo.demo.controller; + +import org.springframework.web.bind.annotation.*; +import yamltopojo.demo.service.SizeConverterService; + +@RestController +@RequestMapping(value = "/") +public class TshirtSizeController { + + private SizeConverterService service; + + public TshirtSizeController(SizeConverterService service) { + this.service = service; + } + + @RequestMapping(value ="convertSize", method = RequestMethod.GET) + public int convertSize(@RequestParam(value = "label") final String label, + @RequestParam(value = "countryCode", required = false) final String countryCode) { + return service.convertSize(label, countryCode); + } + +} diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java new file mode 100644 index 0000000000..8f95e4253b --- /dev/null +++ b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java @@ -0,0 +1,22 @@ +package yamltopojo.demo.service; + +import org.springframework.stereotype.Service; +import yamltopojo.demo.config.TshirtSizeConfig; + + +@Service +public class SizeConverterImpl implements SizeConverterService { + + private TshirtSizeConfig tshirtSizeConfig; + + public SizeConverterImpl(TshirtSizeConfig tshirtSizeConfig) { + this.tshirtSizeConfig = tshirtSizeConfig; + } + + public int convertSize(String label, String countryCode) { + if(countryCode == null) { + return tshirtSizeConfig.getSimpleMapping().get(label); + } + return tshirtSizeConfig.getComplexMapping().get(label).get(countryCode); + } +} diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterService.java b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterService.java new file mode 100644 index 0000000000..3e24681cbe --- /dev/null +++ b/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterService.java @@ -0,0 +1,8 @@ +package yamltopojo.demo.service; + + +public interface SizeConverterService { + + int convertSize(String label, String countryCode); + +} diff --git a/configuration/yaml-to-pojo/src/main/resources/application.yml b/configuration/yaml-to-pojo/src/main/resources/application.yml new file mode 100644 index 0000000000..edd200389e --- /dev/null +++ b/configuration/yaml-to-pojo/src/main/resources/application.yml @@ -0,0 +1,30 @@ +t-shirt-size: + simple-mapping: + XS: 6 + S: 8 + M: 10 + L: 12 + XL: 14 + + + complex-mapping: + XS: + uk: 6 + fr: 34 + us: 2 + S: + uk: 8 + fr: 36 + us: 4 + M: + uk: 10 + fr: 38 + us: 6 + L: + uk: 12 + fr: 40 + us: 8 + XL: + uk: 14 + fr: 42 + us: 10 diff --git a/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/DemoApplicationTests.java b/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/DemoApplicationTests.java new file mode 100644 index 0000000000..dfe980c05c --- /dev/null +++ b/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/DemoApplicationTests.java @@ -0,0 +1,13 @@ +package yamltopojo.demo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DemoApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java b/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java new file mode 100644 index 0000000000..3c1ef6dff5 --- /dev/null +++ b/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java @@ -0,0 +1,38 @@ +package yamltopojo.demo.controller; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import yamltopojo.demo.service.SizeConverterService; + +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.when; + +@ExtendWith(MockitoExtension.class) +class TshirtSizeControllerTest { + + @Mock + private SizeConverterService service; + + @InjectMocks + private TshirtSizeController tested; + + @Test + void convertSize() { + + // Given + String label = "S"; + String countryCode = "fr"; + int result = 36; + + // + when(service.convertSize(label, countryCode)).thenReturn(result); + int actual = tested.convertSize(label, countryCode); + + // Then + assertEquals(actual, result); + + } +} \ No newline at end of file From dbe203e40aaab48257567e017d664bcda8ff6e5e Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Wed, 12 Aug 2020 19:22:31 +0100 Subject: [PATCH 02/10] BAEL-4321 move to new module and use BDD for test names --- .../java/yamltopojo/demo/DemoApplicationTests.java | 13 ------------- .../spring-boot-data-2}/README.md | 0 .../spring-boot-data-2}/pom.xml | 0 .../main/java/yamltopojo/demo/DemoApplication.java | 0 .../yamltopojo/demo/config/TshirtSizeConfig.java | 0 .../demo/controller/TshirtSizeController.java | 2 +- .../yamltopojo/demo/service/SizeConverterImpl.java | 4 ++-- .../demo/service/SizeConverterService.java | 0 .../src/main/resources/application.yml | 0 .../demo/controller/TshirtSizeControllerTest.java | 4 ++-- 10 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/DemoApplicationTests.java rename {configuration/yaml-to-pojo => spring-boot-modules/spring-boot-data-2}/README.md (100%) rename {configuration/yaml-to-pojo => spring-boot-modules/spring-boot-data-2}/pom.xml (100%) rename {configuration/yaml-to-pojo => spring-boot-modules/spring-boot-data-2}/src/main/java/yamltopojo/demo/DemoApplication.java (100%) rename {configuration/yaml-to-pojo => spring-boot-modules/spring-boot-data-2}/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java (100%) rename {configuration/yaml-to-pojo => spring-boot-modules/spring-boot-data-2}/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java (93%) rename {configuration/yaml-to-pojo => spring-boot-modules/spring-boot-data-2}/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java (87%) rename {configuration/yaml-to-pojo => spring-boot-modules/spring-boot-data-2}/src/main/java/yamltopojo/demo/service/SizeConverterService.java (100%) rename {configuration/yaml-to-pojo => spring-boot-modules/spring-boot-data-2}/src/main/resources/application.yml (100%) rename {configuration/yaml-to-pojo => spring-boot-modules/spring-boot-data-2}/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java (89%) diff --git a/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/DemoApplicationTests.java b/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/DemoApplicationTests.java deleted file mode 100644 index dfe980c05c..0000000000 --- a/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/DemoApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package yamltopojo.demo; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class DemoApplicationTests { - - @Test - void contextLoads() { - } - -} diff --git a/configuration/yaml-to-pojo/README.md b/spring-boot-modules/spring-boot-data-2/README.md similarity index 100% rename from configuration/yaml-to-pojo/README.md rename to spring-boot-modules/spring-boot-data-2/README.md diff --git a/configuration/yaml-to-pojo/pom.xml b/spring-boot-modules/spring-boot-data-2/pom.xml similarity index 100% rename from configuration/yaml-to-pojo/pom.xml rename to spring-boot-modules/spring-boot-data-2/pom.xml diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/DemoApplication.java b/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/DemoApplication.java similarity index 100% rename from configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/DemoApplication.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/DemoApplication.java diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java b/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java similarity index 100% rename from configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java b/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java similarity index 93% rename from configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java index d555549bd4..3504579504 100644 --- a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java +++ b/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java @@ -7,7 +7,7 @@ import yamltopojo.demo.service.SizeConverterService; @RequestMapping(value = "/") public class TshirtSizeController { - private SizeConverterService service; + private final SizeConverterService service; public TshirtSizeController(SizeConverterService service) { this.service = service; diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java b/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java similarity index 87% rename from configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java index 8f95e4253b..829950433e 100644 --- a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java +++ b/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java @@ -7,7 +7,7 @@ import yamltopojo.demo.config.TshirtSizeConfig; @Service public class SizeConverterImpl implements SizeConverterService { - private TshirtSizeConfig tshirtSizeConfig; + private final TshirtSizeConfig tshirtSizeConfig; public SizeConverterImpl(TshirtSizeConfig tshirtSizeConfig) { this.tshirtSizeConfig = tshirtSizeConfig; @@ -17,6 +17,6 @@ public class SizeConverterImpl implements SizeConverterService { if(countryCode == null) { return tshirtSizeConfig.getSimpleMapping().get(label); } - return tshirtSizeConfig.getComplexMapping().get(label).get(countryCode); + return tshirtSizeConfig.getComplexMapping().get(label).get(countryCode.toLowerCase()); } } diff --git a/configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterService.java b/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/service/SizeConverterService.java similarity index 100% rename from configuration/yaml-to-pojo/src/main/java/yamltopojo/demo/service/SizeConverterService.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/service/SizeConverterService.java diff --git a/configuration/yaml-to-pojo/src/main/resources/application.yml b/spring-boot-modules/spring-boot-data-2/src/main/resources/application.yml similarity index 100% rename from configuration/yaml-to-pojo/src/main/resources/application.yml rename to spring-boot-modules/spring-boot-data-2/src/main/resources/application.yml diff --git a/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java b/spring-boot-modules/spring-boot-data-2/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java similarity index 89% rename from configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java rename to spring-boot-modules/spring-boot-data-2/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java index 3c1ef6dff5..ae92d7d57f 100644 --- a/configuration/yaml-to-pojo/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java +++ b/spring-boot-modules/spring-boot-data-2/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java @@ -20,14 +20,14 @@ class TshirtSizeControllerTest { private TshirtSizeController tested; @Test - void convertSize() { + void givenSizeConverter_whenLabelIsSandCountryCodeIsFr_thenReturnCorrectSize() { // Given String label = "S"; String countryCode = "fr"; int result = 36; - // + // When when(service.convertSize(label, countryCode)).thenReturn(result); int actual = tested.convertSize(label, countryCode); From 5b3ffa4424ac1af6df151dc6ff77cc6a64dfa4ef Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Wed, 12 Aug 2020 21:16:32 +0100 Subject: [PATCH 03/10] BAEL-4321 correct parent in pom and follow test naming convention --- spring-boot-modules/spring-boot-data-2/pom.xml | 16 ++++++++-------- .../controller/TshirtSizeControllerTest.java | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spring-boot-modules/spring-boot-data-2/pom.xml b/spring-boot-modules/spring-boot-data-2/pom.xml index f6b55718be..0baaf292e8 100644 --- a/spring-boot-modules/spring-boot-data-2/pom.xml +++ b/spring-boot-modules/spring-boot-data-2/pom.xml @@ -3,16 +3,16 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - org.springframework.boot - spring-boot-starter-parent - 2.3.2.RELEASE - + com.baeldung.spring-boot-modules + spring-boot-modules + 1.0.0-SNAPSHOT + ../ - yaml-to-pojo - demo + + spring-boot-data-2 0.0.1-SNAPSHOT - demo - Demo project for YAML into POJO + spring-boot-data-2 + Spring Boot Data Module 1.8 diff --git a/spring-boot-modules/spring-boot-data-2/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java b/spring-boot-modules/spring-boot-data-2/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java index ae92d7d57f..eb6f896be9 100644 --- a/spring-boot-modules/spring-boot-data-2/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java +++ b/spring-boot-modules/spring-boot-data-2/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java @@ -11,7 +11,7 @@ import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) -class TshirtSizeControllerTest { +class TshirtSizeControllerUnitTest { @Mock private SizeConverterService service; @@ -20,7 +20,7 @@ class TshirtSizeControllerTest { private TshirtSizeController tested; @Test - void givenSizeConverter_whenLabelIsSandCountryCodeIsFr_thenReturnCorrectSize() { + void whenConvertSize_thenOK() { // Given String label = "S"; From 7e1461c40a650964af58464acb27d2b48da11b7c Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Wed, 12 Aug 2020 22:00:11 +0100 Subject: [PATCH 04/10] BAEL-4321 fix package name --- .../demo => com/baeldung/boot/data}/DemoApplication.java | 0 .../demo => com/baeldung/boot/data}/config/TshirtSizeConfig.java | 0 .../baeldung/boot/data}/controller/TshirtSizeController.java | 0 .../baeldung/boot/data}/service/SizeConverterImpl.java | 0 .../baeldung/boot/data}/service/SizeConverterService.java | 0 .../baeldung/boot/data}/controller/TshirtSizeControllerTest.java | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename spring-boot-modules/spring-boot-data-2/src/main/java/{yamltopojo/demo => com/baeldung/boot/data}/DemoApplication.java (100%) rename spring-boot-modules/spring-boot-data-2/src/main/java/{yamltopojo/demo => com/baeldung/boot/data}/config/TshirtSizeConfig.java (100%) rename spring-boot-modules/spring-boot-data-2/src/main/java/{yamltopojo/demo => com/baeldung/boot/data}/controller/TshirtSizeController.java (100%) rename spring-boot-modules/spring-boot-data-2/src/main/java/{yamltopojo/demo => com/baeldung/boot/data}/service/SizeConverterImpl.java (100%) rename spring-boot-modules/spring-boot-data-2/src/main/java/{yamltopojo/demo => com/baeldung/boot/data}/service/SizeConverterService.java (100%) rename spring-boot-modules/spring-boot-data-2/src/test/java/{yamltopojo/demo => com/baeldung/boot/data}/controller/TshirtSizeControllerTest.java (100%) diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/DemoApplication.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/DemoApplication.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/DemoApplication.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/DemoApplication.java diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/config/TshirtSizeConfig.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/config/TshirtSizeConfig.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/config/TshirtSizeConfig.java diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/controller/TshirtSizeController.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/controller/TshirtSizeController.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/controller/TshirtSizeController.java diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterImpl.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/service/SizeConverterImpl.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterImpl.java diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/service/SizeConverterService.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterService.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/yamltopojo/demo/service/SizeConverterService.java rename to spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterService.java diff --git a/spring-boot-modules/spring-boot-data-2/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java b/spring-boot-modules/spring-boot-data-2/src/test/java/com/baeldung/boot/data/controller/TshirtSizeControllerTest.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/test/java/yamltopojo/demo/controller/TshirtSizeControllerTest.java rename to spring-boot-modules/spring-boot-data-2/src/test/java/com/baeldung/boot/data/controller/TshirtSizeControllerTest.java From b94d29a1cc57ada0d4ee3fc0ce31aaa70359c3aa Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Thu, 13 Aug 2020 07:19:44 +0100 Subject: [PATCH 05/10] BAEL-4321 fix package name everywhere --- .../src/main/java/com/baeldung/boot/data/DemoApplication.java | 4 ++-- .../java/com/baeldung/boot/data/config/TshirtSizeConfig.java | 2 +- .../baeldung/boot/data/controller/TshirtSizeController.java | 4 ++-- .../com/baeldung/boot/data/service/SizeConverterImpl.java | 4 ++-- .../com/baeldung/boot/data/service/SizeConverterService.java | 2 +- .../boot/data/controller/TshirtSizeControllerTest.java | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/DemoApplication.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/DemoApplication.java index ec8df793c2..125cba6283 100644 --- a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/DemoApplication.java +++ b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/DemoApplication.java @@ -1,9 +1,9 @@ -package yamltopojo.demo; +package com.baeldung.boot.data; +import com.baeldung.boot.data.config.TshirtSizeConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; -import yamltopojo.demo.config.TshirtSizeConfig; @SpringBootApplication @EnableConfigurationProperties(TshirtSizeConfig.class) diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/config/TshirtSizeConfig.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/config/TshirtSizeConfig.java index 8f8d2e5b39..000f5b6826 100644 --- a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/config/TshirtSizeConfig.java +++ b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/config/TshirtSizeConfig.java @@ -1,4 +1,4 @@ -package yamltopojo.demo.config; +package com.baeldung.boot.data.config; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/controller/TshirtSizeController.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/controller/TshirtSizeController.java index 3504579504..6446a17317 100644 --- a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/controller/TshirtSizeController.java +++ b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/controller/TshirtSizeController.java @@ -1,7 +1,7 @@ -package yamltopojo.demo.controller; +package com.baeldung.boot.data.controller; import org.springframework.web.bind.annotation.*; -import yamltopojo.demo.service.SizeConverterService; +import com.baeldung.boot.data.service.SizeConverterService; @RestController @RequestMapping(value = "/") diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterImpl.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterImpl.java index 829950433e..ccb5a06da4 100644 --- a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterImpl.java +++ b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterImpl.java @@ -1,7 +1,7 @@ -package yamltopojo.demo.service; +package com.baeldung.boot.data.service; import org.springframework.stereotype.Service; -import yamltopojo.demo.config.TshirtSizeConfig; +import com.baeldung.boot.data.config.TshirtSizeConfig; @Service diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterService.java b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterService.java index 3e24681cbe..91cf2bf0b4 100644 --- a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterService.java +++ b/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterService.java @@ -1,4 +1,4 @@ -package yamltopojo.demo.service; +package com.baeldung.boot.data.service; public interface SizeConverterService { diff --git a/spring-boot-modules/spring-boot-data-2/src/test/java/com/baeldung/boot/data/controller/TshirtSizeControllerTest.java b/spring-boot-modules/spring-boot-data-2/src/test/java/com/baeldung/boot/data/controller/TshirtSizeControllerTest.java index eb6f896be9..1d60eb41c0 100644 --- a/spring-boot-modules/spring-boot-data-2/src/test/java/com/baeldung/boot/data/controller/TshirtSizeControllerTest.java +++ b/spring-boot-modules/spring-boot-data-2/src/test/java/com/baeldung/boot/data/controller/TshirtSizeControllerTest.java @@ -1,11 +1,11 @@ -package yamltopojo.demo.controller; +package com.baeldung.boot.data.controller; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import yamltopojo.demo.service.SizeConverterService; +import com.baeldung.boot.data.service.SizeConverterService; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.when; From 223944628593984ee2c663e9dfb317de09b45ec8 Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Sat, 15 Aug 2020 15:01:37 +0100 Subject: [PATCH 06/10] BAEL-4321 use properties module and delete ReadMe --- spring-boot-modules/spring-boot-data-2/README.md | 9 --------- .../pom.xml | 6 +++--- .../com/baeldung/boot/properties}/DemoApplication.java | 0 .../boot/properties}/config/TshirtSizeConfig.java | 0 .../properties}/controller/TshirtSizeController.java | 0 .../boot/properties}/service/SizeConverterImpl.java | 0 .../boot/properties}/service/SizeConverterService.java | 0 .../src/main/resources/application.yml | 0 .../properties}/controller/TshirtSizeControllerTest.java | 0 9 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 spring-boot-modules/spring-boot-data-2/README.md rename spring-boot-modules/{spring-boot-data-2 => spring-boot-properties-3}/pom.xml (90%) rename spring-boot-modules/{spring-boot-data-2/src/main/java/com/baeldung/boot/data => spring-boot-properties-3/src/main/java/com/baeldung/boot/properties}/DemoApplication.java (100%) rename spring-boot-modules/{spring-boot-data-2/src/main/java/com/baeldung/boot/data => spring-boot-properties-3/src/main/java/com/baeldung/boot/properties}/config/TshirtSizeConfig.java (100%) rename spring-boot-modules/{spring-boot-data-2/src/main/java/com/baeldung/boot/data => spring-boot-properties-3/src/main/java/com/baeldung/boot/properties}/controller/TshirtSizeController.java (100%) rename spring-boot-modules/{spring-boot-data-2/src/main/java/com/baeldung/boot/data => spring-boot-properties-3/src/main/java/com/baeldung/boot/properties}/service/SizeConverterImpl.java (100%) rename spring-boot-modules/{spring-boot-data-2/src/main/java/com/baeldung/boot/data => spring-boot-properties-3/src/main/java/com/baeldung/boot/properties}/service/SizeConverterService.java (100%) rename spring-boot-modules/{spring-boot-data-2 => spring-boot-properties-3}/src/main/resources/application.yml (100%) rename spring-boot-modules/{spring-boot-data-2/src/test/java/com/baeldung/boot/data => spring-boot-properties-3/src/test/java/com/baeldung/boot/properties}/controller/TshirtSizeControllerTest.java (100%) diff --git a/spring-boot-modules/spring-boot-data-2/README.md b/spring-boot-modules/spring-boot-data-2/README.md deleted file mode 100644 index 9dba74a7e5..0000000000 --- a/spring-boot-modules/spring-boot-data-2/README.md +++ /dev/null @@ -1,9 +0,0 @@ -This is a demo application for using YAML configuration for defining values in a POJO class. - -The application has an endpoint to provide T-shirt size conversion for label and countrycode. - -If you run this service locally you can call this endpoint on: - -`localhost:8080/convertSize?label=M&countryCode=fr` - -It should return the size as int. \ No newline at end of file diff --git a/spring-boot-modules/spring-boot-data-2/pom.xml b/spring-boot-modules/spring-boot-properties-3/pom.xml similarity index 90% rename from spring-boot-modules/spring-boot-data-2/pom.xml rename to spring-boot-modules/spring-boot-properties-3/pom.xml index 0baaf292e8..1e3d627b19 100644 --- a/spring-boot-modules/spring-boot-data-2/pom.xml +++ b/spring-boot-modules/spring-boot-properties-3/pom.xml @@ -9,10 +9,10 @@ ../ - spring-boot-data-2 + spring-boot-properties-3 0.0.1-SNAPSHOT - spring-boot-data-2 - Spring Boot Data Module + spring-boot-properties-3 + Spring Boot Properties Module 1.8 diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/DemoApplication.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/DemoApplication.java rename to spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/config/TshirtSizeConfig.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/config/TshirtSizeConfig.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/config/TshirtSizeConfig.java rename to spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/config/TshirtSizeConfig.java diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/controller/TshirtSizeController.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/controller/TshirtSizeController.java rename to spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterImpl.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterImpl.java rename to spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java diff --git a/spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterService.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterService.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/java/com/baeldung/boot/data/service/SizeConverterService.java rename to spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterService.java diff --git a/spring-boot-modules/spring-boot-data-2/src/main/resources/application.yml b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/main/resources/application.yml rename to spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml diff --git a/spring-boot-modules/spring-boot-data-2/src/test/java/com/baeldung/boot/data/controller/TshirtSizeControllerTest.java b/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java similarity index 100% rename from spring-boot-modules/spring-boot-data-2/src/test/java/com/baeldung/boot/data/controller/TshirtSizeControllerTest.java rename to spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java From 3c44e7af209b2f93838d2503f673ff6d4330c5e7 Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Sat, 15 Aug 2020 15:04:10 +0100 Subject: [PATCH 07/10] BAEL-4321 fix indentation --- .../boot/properties/controller/TshirtSizeController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java index 6446a17317..82263eaeed 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java @@ -14,8 +14,7 @@ public class TshirtSizeController { } @RequestMapping(value ="convertSize", method = RequestMethod.GET) - public int convertSize(@RequestParam(value = "label") final String label, - @RequestParam(value = "countryCode", required = false) final String countryCode) { + public int convertSize(@RequestParam(value = "label") final String label, @RequestParam(value = "countryCode", required = false) final String countryCode) { return service.convertSize(label, countryCode); } From e399a6a8bc9c79d96a27a62eb960e7e6c209620e Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Sat, 15 Aug 2020 15:34:56 +0100 Subject: [PATCH 08/10] BAEL-4321 fix package name in imports and convert tabs to spaces --- .../baeldung/boot/properties/DemoApplication.java | 8 ++++---- .../boot/properties/config/TshirtSizeConfig.java | 2 +- .../controller/TshirtSizeController.java | 2 +- .../boot/properties/service/SizeConverterImpl.java | 2 +- .../properties/service/SizeConverterService.java | 2 +- .../src/main/resources/application.yml | 14 +++++++------- .../controller/TshirtSizeControllerTest.java | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java index 125cba6283..634cb211b2 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java @@ -1,4 +1,4 @@ -package com.baeldung.boot.data; +package com.baeldung.boot.properties; import com.baeldung.boot.data.config.TshirtSizeConfig; import org.springframework.boot.SpringApplication; @@ -9,8 +9,8 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties @EnableConfigurationProperties(TshirtSizeConfig.class) public class DemoApplication { - public static void main(String[] args) { - SpringApplication.run(DemoApplication.class, args); - } + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } } diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/config/TshirtSizeConfig.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/config/TshirtSizeConfig.java index 000f5b6826..690763ab7b 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/config/TshirtSizeConfig.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/config/TshirtSizeConfig.java @@ -1,4 +1,4 @@ -package com.baeldung.boot.data.config; +package com.baeldung.boot.properties.config; import org.springframework.boot.context.properties.ConfigurationProperties; diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java index 82263eaeed..2f5c523c2e 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java @@ -1,4 +1,4 @@ -package com.baeldung.boot.data.controller; +package com.baeldung.boot.properties.controller; import org.springframework.web.bind.annotation.*; import com.baeldung.boot.data.service.SizeConverterService; diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java index ccb5a06da4..8554783493 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java @@ -1,4 +1,4 @@ -package com.baeldung.boot.data.service; +package com.baeldung.boot.properties.service; import org.springframework.stereotype.Service; import com.baeldung.boot.data.config.TshirtSizeConfig; diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterService.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterService.java index 91cf2bf0b4..412199b176 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterService.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterService.java @@ -1,4 +1,4 @@ -package com.baeldung.boot.data.service; +package com.baeldung.boot.properties.service; public interface SizeConverterService { diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml index edd200389e..8779cb6b0c 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml +++ b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.yml @@ -1,10 +1,10 @@ -t-shirt-size: - simple-mapping: - XS: 6 - S: 8 - M: 10 - L: 12 - XL: 14 + t-shirt-size: + simple-mapping: + XS: 6 + S: 8 + M: 10 + L: 12 + XL: 14 complex-mapping: diff --git a/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java b/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java index 1d60eb41c0..96584d6077 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java +++ b/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java @@ -1,4 +1,4 @@ -package com.baeldung.boot.data.controller; +package com.baeldung.boot.properties.controller; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; From 130133d73bf1a2ba4ca4c25394bb92755602240d Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Sat, 15 Aug 2020 15:39:01 +0100 Subject: [PATCH 09/10] BAEL-4321 fix leftover data package names --- .../main/java/com/baeldung/boot/properties/DemoApplication.java | 2 +- .../boot/properties/controller/TshirtSizeController.java | 2 +- .../com/baeldung/boot/properties/service/SizeConverterImpl.java | 2 +- .../boot/properties/controller/TshirtSizeControllerTest.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java index 634cb211b2..cf2fb7f981 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/DemoApplication.java @@ -1,6 +1,6 @@ package com.baeldung.boot.properties; -import com.baeldung.boot.data.config.TshirtSizeConfig; +import com.baeldung.boot.properties.config.TshirtSizeConfig; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java index 2f5c523c2e..6b713c5be8 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/controller/TshirtSizeController.java @@ -1,7 +1,7 @@ package com.baeldung.boot.properties.controller; import org.springframework.web.bind.annotation.*; -import com.baeldung.boot.data.service.SizeConverterService; +import com.baeldung.boot.properties.service.SizeConverterService; @RestController @RequestMapping(value = "/") diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java index 8554783493..34f7fe2ded 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/boot/properties/service/SizeConverterImpl.java @@ -1,7 +1,7 @@ package com.baeldung.boot.properties.service; import org.springframework.stereotype.Service; -import com.baeldung.boot.data.config.TshirtSizeConfig; +import com.baeldung.boot.properties.config.TshirtSizeConfig; @Service diff --git a/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java b/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java index 96584d6077..0b70ed8622 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java +++ b/spring-boot-modules/spring-boot-properties-3/src/test/java/com/baeldung/boot/properties/controller/TshirtSizeControllerTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import com.baeldung.boot.data.service.SizeConverterService; +import com.baeldung.boot.properties.service.SizeConverterService; import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.when; From 3233bd6adc5e5485d9af8573c200291bd95c3beb Mon Sep 17 00:00:00 2001 From: Trixi Turny Date: Mon, 17 Aug 2020 12:41:09 +0100 Subject: [PATCH 10/10] BAEL-4321 add new module to pom --- spring-boot-modules/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-modules/pom.xml b/spring-boot-modules/pom.xml index 84f1f0e86c..f4e3e534c8 100644 --- a/spring-boot-modules/pom.xml +++ b/spring-boot-modules/pom.xml @@ -56,6 +56,7 @@ spring-boot-performance spring-boot-properties spring-boot-properties-2 + spring-boot-properties-3 spring-boot-property-exp spring-boot-runtime spring-boot-security