argumentResolvers) {
+ argumentResolvers.add(deviceHandlerMethodArgumentResolver());
+ }
+
+}
diff --git a/spring-mobile/src/main/java/com/baeldung/controller/IndexController.java b/spring-mobile/src/main/java/com/baeldung/controller/IndexController.java
index 196fb680e7..49880f355a 100644
--- a/spring-mobile/src/main/java/com/baeldung/controller/IndexController.java
+++ b/spring-mobile/src/main/java/com/baeldung/controller/IndexController.java
@@ -16,13 +16,16 @@ public class IndexController {
String deviceType = "browser";
String platform = "browser";
+ String viewName = "index";
if (device.isNormal()) {
deviceType = "browser";
} else if (device.isMobile()) {
deviceType = "mobile";
+ viewName = "mobile/index";
} else if (device.isTablet()) {
deviceType = "tablet";
+ viewName = "tablet/index";
}
platform = device.getDevicePlatform().name();
@@ -33,7 +36,7 @@ public class IndexController {
LOGGER.info("Client Device Type: " + deviceType + ", Platform: " + platform);
- return "index";
+ return viewName;
}
}
diff --git a/spring-mobile/src/main/resources/application.properties b/spring-mobile/src/main/resources/application.properties
index c0bc91f9ac..7d964f48fb 100644
--- a/spring-mobile/src/main/resources/application.properties
+++ b/spring-mobile/src/main/resources/application.properties
@@ -1 +1,3 @@
-spring.mobile.devicedelegatingviewresolver.enabled: true
\ No newline at end of file
+spring.mobile.devicedelegatingviewresolver.enabled: true
+spring.freemarker.template-loader-path: classpath:/templates
+spring.freemarker.suffix: .ftl
\ No newline at end of file
diff --git a/spring-rest-hal-browser/pom.xml b/spring-rest-hal-browser/pom.xml
index adef8bf2b0..32a0b52875 100644
--- a/spring-rest-hal-browser/pom.xml
+++ b/spring-rest-hal-browser/pom.xml
@@ -9,9 +9,9 @@
com.baeldung
- parent-boot-1
+ parent-boot-2
0.0.1-SNAPSHOT
- ../parent-boot-1
+ ../parent-boot-2
@@ -19,25 +19,26 @@
org.springframework.boot
spring-boot-starter-web
- ${spring-boot.version}
org.springframework.boot
spring-boot-starter-data-jpa
- ${spring-boot.version}
org.springframework.data
spring-data-rest-hal-browser
- ${spring-data.version}
com.h2database
h2
- ${h2.version}
+
+
+ net.bytebuddy
+ byte-buddy-dep
+ ${bytebuddy.version}
@@ -55,9 +56,7 @@
- 2.0.3.RELEASE
- 3.0.8.RELEASE
- 1.4.197
+ 1.10.10
1.8
1.8
diff --git a/spring-security-modules/spring-security-mvc-boot-2/README.md b/spring-security-modules/spring-security-mvc-boot-2/README.md
index 3c95086d21..7c53d03698 100644
--- a/spring-security-modules/spring-security-mvc-boot-2/README.md
+++ b/spring-security-modules/spring-security-mvc-boot-2/README.md
@@ -10,4 +10,5 @@ The "REST With Spring" Classes: http://github.learnspringsecurity.com
- [Multiple Authentication Providers in Spring Security](https://www.baeldung.com/spring-security-multiple-auth-providers)
- [Two Login Pages with Spring Security](https://www.baeldung.com/spring-security-two-login-pages)
- [HTTPS using Self-Signed Certificate in Spring Boot](https://www.baeldung.com/spring-boot-https-self-signed-certificate)
-- [Spring Security: Exploring JDBC Authentication](https://www.baeldung.com/spring-security-jdbc-authentication)
\ No newline at end of file
+- [Spring Security: Exploring JDBC Authentication](https://www.baeldung.com/spring-security-jdbc-authentication)
+- [Spring Security Custom Logout Handler](https://www.baeldung.com/spring-security-custom-logout-handler)
diff --git a/spring-security-modules/spring-security-okta/README.md b/spring-security-modules/spring-security-okta/README.md
new file mode 100644
index 0000000000..6ea4817e19
--- /dev/null
+++ b/spring-security-modules/spring-security-okta/README.md
@@ -0,0 +1,3 @@
+### Relevant Articles:
+
+- [Spring Security With Okta](https://www.baeldung.com/spring-security-okta)
diff --git a/spring-soap/README.md b/spring-soap/README.md
index c23f0bc6f0..ca5f58c67e 100644
--- a/spring-soap/README.md
+++ b/spring-soap/README.md
@@ -5,3 +5,4 @@ This module contains articles about SOAP APIs with Spring
### Relevant articles:
- [Creating a SOAP Web Service with Spring](https://www.baeldung.com/spring-boot-soap-web-service)
+- [Invoking a SOAP Web Service in Spring](https://www.baeldung.com/spring-soap-web-service)
diff --git a/spring-thymeleaf-3/src/main/java/com/baeldung/thymeleaf/currencies/CurrenciesController.java b/spring-thymeleaf-3/src/main/java/com/baeldung/thymeleaf/currencies/CurrenciesController.java
new file mode 100644
index 0000000000..206cf32683
--- /dev/null
+++ b/spring-thymeleaf-3/src/main/java/com/baeldung/thymeleaf/currencies/CurrenciesController.java
@@ -0,0 +1,22 @@
+package com.baeldung.thymeleaf.currencies;
+
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@Controller
+public class CurrenciesController {
+
+ @GetMapping(value = "/currency")
+ public String exchange(
+ @RequestParam(value = "amount", required = false) String amount,
+ @RequestParam(value = "amountList", required = false) List amountList,
+ Locale locale) {
+
+ return "currencies/currencies";
+ }
+}
diff --git a/spring-thymeleaf-3/src/main/resources/templates/currencies/currencies.html b/spring-thymeleaf-3/src/main/resources/templates/currencies/currencies.html
new file mode 100644
index 0000000000..c2f44265dd
--- /dev/null
+++ b/spring-thymeleaf-3/src/main/resources/templates/currencies/currencies.html
@@ -0,0 +1,21 @@
+
+
+
+
+ Currency table
+
+
+ Currency format by Locale
+
+
+ Currency Arrays format by Locale
+
+
+ Remove decimal values
+
+
+ Replace decimal points
+
+
+
\ No newline at end of file
diff --git a/spring-thymeleaf-3/src/test/java/com/baeldung/thymeleaf/currencies/CurrenciesControllerIntegrationTest.java b/spring-thymeleaf-3/src/test/java/com/baeldung/thymeleaf/currencies/CurrenciesControllerIntegrationTest.java
new file mode 100644
index 0000000000..02bf8a9ee0
--- /dev/null
+++ b/spring-thymeleaf-3/src/test/java/com/baeldung/thymeleaf/currencies/CurrenciesControllerIntegrationTest.java
@@ -0,0 +1,68 @@
+package com.baeldung.thymeleaf.currencies;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+import org.springframework.test.web.servlet.MockMvc;
+import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
+
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@AutoConfigureMockMvc(printOnlyOnFailure = false)
+public class CurrenciesControllerIntegrationTest {
+
+ @Autowired
+ private MockMvc mockMvc;
+
+ @Test
+ public void whenCallCurrencyWithSpanishLocale_ThenReturnProperCurrency() throws Exception {
+ mockMvc.perform(MockMvcRequestBuilders.get("/currency")
+ .header("Accept-Language", "es-ES")
+ .param("amount", "10032.5"))
+ .andExpect(status().isOk())
+ .andExpect(content().string(containsString("10.032,50 €")));
+ }
+
+ @Test
+ public void whenCallCurrencyWithUSALocale_ThenReturnProperCurrency() throws Exception {
+ mockMvc.perform(MockMvcRequestBuilders.get("/currency")
+ .header("Accept-Language", "en-US")
+ .param("amount", "10032.5"))
+ .andExpect(status().isOk())
+ .andExpect(content().string(containsString("$10,032.50")));
+ }
+
+ @Test
+ public void whenCallCurrencyWithRomanianLocaleWithArrays_ThenReturnLocaleCurrencies() throws Exception {
+ mockMvc.perform(MockMvcRequestBuilders.get("/currency")
+ .header("Accept-Language", "ro-RO")
+ .param("amountList", "10", "20", "30"))
+ .andExpect(status().isOk())
+ .andExpect(content().string(containsString("10,00 RON, 20,00 RON, 30,00 RON")));
+ }
+
+ @Test
+ public void whenCallCurrencyWithUSALocaleWithoutDecimal_ThenReturnCurrencyWithoutTrailingZeros() throws Exception {
+ mockMvc.perform(MockMvcRequestBuilders.get("/currency")
+ .header("Accept-Language", "en-US")
+ .param("amount", "10032"))
+ .andExpect(status().isOk())
+ .andExpect(content().string(containsString("$10,032")));
+ }
+
+ @Test
+ public void whenCallCurrencyWithUSALocale_ThenReturnReplacedDecimalPoint() throws Exception {
+ mockMvc.perform(MockMvcRequestBuilders.get("/currency")
+ .header("Accept-Language", "en-US")
+ .param("amount", "1.5"))
+ .andExpect(status().isOk())
+ .andExpect(content().string(containsString("1,5")));
+ }
+}
diff --git a/terraform/README.md b/terraform/README.md
index 19abd2ff20..b2a9539727 100644
--- a/terraform/README.md
+++ b/terraform/README.md
@@ -1,3 +1,4 @@
### Relevant Articles:
- [Introduction to Terraform](https://www.baeldung.com/ops/terraform-intro)
+- [Best Practices When Using Terraform](https://www.baeldung.com/ops/terraform-best-practices)
diff --git a/testing-modules/assertion-libraries/README.md b/testing-modules/assertion-libraries/README.md
index d69457fdeb..ca4cc86f7e 100644
--- a/testing-modules/assertion-libraries/README.md
+++ b/testing-modules/assertion-libraries/README.md
@@ -10,4 +10,4 @@
- [Custom Assertions with AssertJ](http://www.baeldung.com/assertj-custom-assertion)
- [Using Conditions with AssertJ Assertions](http://www.baeldung.com/assertj-conditions)
- [AssertJ Exception Assertions](http://www.baeldung.com/assertj-exception-assertion)
-
+- [Asserting Log Messages With JUnit](https://www.baeldung.com/junit-asserting-logs)