From ede44be6120d5b6e73fa716bcefdf1740afbca7a Mon Sep 17 00:00:00 2001 From: mikr Date: Sun, 9 Feb 2020 14:43:20 +0100 Subject: [PATCH 01/62] BAEL-20604 Fix Mule ESB integration test --- muleesb/pom.xml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/muleesb/pom.xml b/muleesb/pom.xml index c8468c1e00..bd719b5a1e 100644 --- a/muleesb/pom.xml +++ b/muleesb/pom.xml @@ -108,19 +108,15 @@ org.mule.tools muleesb-maven-plugin - ${muleesb-maven-plugin.version} - ${mule.version} - /home/abir/AnypointStudio/workspace/variablescopetest + + com.mulesoft.muleesb.distributions + mule-ee-distribution-standalone + ${mule.version} + tar.gz + + 2 - - - deploy - - start - - - org.codehaus.mojo From 2d7702ab7275847bc0975ecb29224b2765f129d6 Mon Sep 17 00:00:00 2001 From: mikr Date: Tue, 25 Feb 2020 14:17:27 +0100 Subject: [PATCH 02/62] BAEL-20604 Update Mule ESB version --- muleesb/pom.xml | 50 ++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/muleesb/pom.xml b/muleesb/pom.xml index bd719b5a1e..fb386a1d77 100644 --- a/muleesb/pom.xml +++ b/muleesb/pom.xml @@ -20,70 +20,70 @@ org.mule.modules mule-module-spring-config - ${mule.version} + ${mule.dependecies.version} provided org.mule.transports mule-transport-file - ${mule.version} + ${mule.dependecies.version} provided org.mule.transports mule-transport-http - ${mule.version} + ${mule.dependecies.version} provided org.mule.transports mule-transport-jdbc - ${mule.version} + ${mule.dependecies.version} provided org.mule.transports mule-transport-jms - ${mule.version} + ${mule.dependecies.version} provided org.mule.transports mule-transport-vm - ${mule.version} + ${mule.dependecies.version} provided org.mule.modules mule-module-scripting - ${mule.version} + ${mule.dependecies.version} provided org.mule.modules mule-module-xml - ${mule.version} + ${mule.dependecies.version} provided org.mule.tests mule-tests-functional - ${mule.version} + ${mule.dependecies.version} test org.mule.modules mule-module-apikit - ${mule.version} + ${mule.dependecies.version} provided com.mulesoft.munit mule-munit-support - ${mule.munit.support.version} + ${mule.dependecies.version} test @@ -106,17 +106,22 @@ - org.mule.tools - muleesb-maven-plugin + org.mule.tools.maven + mule-maven-plugin + 2.2.1 - - com.mulesoft.muleesb.distributions - mule-ee-distribution-standalone - ${mule.version} - tar.gz - - 2 + standalone + ${mule.version} + + + deploy + deploy + + deploy + + + org.codehaus.mojo @@ -206,11 +211,10 @@ - 3.8.1 + 4.2.1 1.2 1.3.6 - 3.9.0 - 1.0 + 3.9.0 1.7 From 27bbbdad76558dc2be6f479f503033e9791f13f5 Mon Sep 17 00:00:00 2001 From: mikr Date: Sat, 29 Feb 2020 15:30:39 +0100 Subject: [PATCH 03/62] BAEL-20604 Update Mule ESB version to 3.9.0 --- muleesb/pom.xml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/muleesb/pom.xml b/muleesb/pom.xml index fb386a1d77..e7c7e50cbe 100644 --- a/muleesb/pom.xml +++ b/muleesb/pom.xml @@ -20,70 +20,70 @@ org.mule.modules mule-module-spring-config - ${mule.dependecies.version} + ${mule.version} provided org.mule.transports mule-transport-file - ${mule.dependecies.version} + ${mule.version} provided org.mule.transports mule-transport-http - ${mule.dependecies.version} + ${mule.version} provided org.mule.transports mule-transport-jdbc - ${mule.dependecies.version} + ${mule.version} provided org.mule.transports mule-transport-jms - ${mule.dependecies.version} + ${mule.version} provided org.mule.transports mule-transport-vm - ${mule.dependecies.version} + ${mule.version} provided org.mule.modules mule-module-scripting - ${mule.dependecies.version} + ${mule.version} provided org.mule.modules mule-module-xml - ${mule.dependecies.version} + ${mule.version} provided org.mule.tests mule-tests-functional - ${mule.dependecies.version} + ${mule.version} test org.mule.modules mule-module-apikit - ${mule.dependecies.version} + ${mule.version} provided com.mulesoft.munit mule-munit-support - ${mule.dependecies.version} + ${mule.version} test @@ -211,10 +211,9 @@ - 4.2.1 + 3.9.0 1.2 1.3.6 - 3.9.0 1.7 From 82f3d5f4afb1c8e441f6b9d3110d47fee04380f2 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:27:34 +0800 Subject: [PATCH 04/62] Update README.md --- spring-security-modules/spring-security-rest/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-security-modules/spring-security-rest/README.md b/spring-security-modules/spring-security-rest/README.md index 00bc2a1403..f7e91b85dc 100644 --- a/spring-security-modules/spring-security-rest/README.md +++ b/spring-security-modules/spring-security-rest/README.md @@ -16,3 +16,4 @@ The "Learn Spring Security" Classes: http://github.learnspringsecurity.com - [Intro to Spring Security Expressions](https://www.baeldung.com/spring-security-expressions) - [Spring Security for a REST API](https://www.baeldung.com/securing-a-restful-web-service-with-spring-security) - [Spring Security Expressions - hasRole Example](https://www.baeldung.com/spring-security-expressions-basic) +- [Error Handling for REST with Spring](https://www.baeldung.com/exception-handling-for-rest-with-spring) From 82a955a18152c686bde3260e236f87a067f5df3d Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:32:33 +0800 Subject: [PATCH 05/62] Update README.md --- linux-bash/text/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-bash/text/README.md b/linux-bash/text/README.md index e0ee0c1600..de99c1962a 100644 --- a/linux-bash/text/README.md +++ b/linux-bash/text/README.md @@ -1,3 +1,3 @@ ### Relevant Articles: -- [Linux Commands – Remove All Text After X](https://www.baeldung.com/linux/remove-text-after-x-in-file) +- [Linux Commands – Remove All Text After X](https://www.baeldung.com/linux/tr-manipulate-strings) From 52577b5e2b7d3814195c643903325f853f17395a Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:34:11 +0800 Subject: [PATCH 06/62] Update README.md --- core-java-modules/core-java-lang-operators/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core-java-modules/core-java-lang-operators/README.md b/core-java-modules/core-java-lang-operators/README.md index 3af2c8885b..facbf40fc6 100644 --- a/core-java-modules/core-java-lang-operators/README.md +++ b/core-java-modules/core-java-lang-operators/README.md @@ -11,5 +11,4 @@ This module contains articles about Java operators - [Java Compound Operators](https://www.baeldung.com/java-compound-operators) - [The XOR Operator in Java](https://www.baeldung.com/java-xor-operator) - [Java Bitwise Operators](https://www.baeldung.com/java-bitwise-operators) -- [Bitwise & vs Logical && Operators](https://www.baeldung.com/bitwise-vs-logical-operators/) - +- [Bitwise & vs Logical && Operators](https://www.baeldung.com/java-bitwise-vs-logical-and) From 271ad64922d874eff2a74662da71d2a5be3c17d7 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:37:05 +0800 Subject: [PATCH 07/62] Update README.md --- netflix-modules/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netflix-modules/README.md b/netflix-modules/README.md index 4afea527df..7f7a9656fb 100644 --- a/netflix-modules/README.md +++ b/netflix-modules/README.md @@ -4,4 +4,4 @@ This module contains articles about Netflix. ### Relevant articles -- [Introduction to Netflix Genie](https://github.com/eugenp/tutorials/tree/master/netflix/genie) +- [Introduction to Netflix Genie](https://www.baeldung.com/netflix-genie-intro) From 2a0cf2b7432330f0e6a259d8e33698b32b7777d8 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:40:11 +0800 Subject: [PATCH 08/62] Update README.md --- apache-poi/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apache-poi/README.md b/apache-poi/README.md index 742220aebc..b562fefc29 100644 --- a/apache-poi/README.md +++ b/apache-poi/README.md @@ -8,4 +8,4 @@ This module contains articles about Apache POI - [Creating a MS PowerPoint Presentation in Java](https://www.baeldung.com/apache-poi-slideshow) - [Merge Cells in Excel Using Apache POI](https://www.baeldung.com/java-apache-poi-merge-cells) - [Get String Value of Excel Cell with Apache POI](https://www.baeldung.com/java-apache-poi-cell-string-value) -- [Read Excel Cell Value Rather Than Formula With Apache POI](https://github.com/eugenp/tutorials/tree/master/apache-poi) +- [Read Excel Cell Value Rather Than Formula With Apache POI](https://www.baeldung.com/apache-poi-read-cell-value-formula) From dbb3bac00b227b941ec6a8593746fa04e6bbc4a4 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:42:10 +0800 Subject: [PATCH 09/62] Update README.md --- java-numbers-2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java-numbers-2/README.md b/java-numbers-2/README.md index 2d0d5443b1..ba9e14965d 100644 --- a/java-numbers-2/README.md +++ b/java-numbers-2/README.md @@ -13,7 +13,7 @@ This module contains articles about numbers in Java. - [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers) - [Finding the Least Common Multiple in Java](https://www.baeldung.com/java-least-common-multiple) - [Binary Numbers in Java](https://www.baeldung.com/java-binary-numbers) -- [Generating Random Numbers in a Range in Java](https://www.baeldung.com/java-generating-random-numbers) +- [Generating Random Numbers in a Range in Java](https://www.baeldung.com/java-generating-random-numbers-in-range) - [Listing Numbers Within a Range in Java](https://www.baeldung.com/java-listing-numbers-within-a-range) - [Fibonacci Series in Java](https://www.baeldung.com/java-fibonacci) - More articles: [[<-- prev]](/../java-numbers) From 07b9fb4be047b7504fc258328e0fd1203a58f13a Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:48:49 +0800 Subject: [PATCH 10/62] Update README.md --- core-java-modules/core-java/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-java-modules/core-java/README.md b/core-java-modules/core-java/README.md index 033d8032bf..bffb88cafb 100644 --- a/core-java-modules/core-java/README.md +++ b/core-java-modules/core-java/README.md @@ -11,7 +11,7 @@ - [Introduction to Java Serialization](http://www.baeldung.com/java-serialization) - [Guide to UUID in Java](http://www.baeldung.com/java-uuid) - [Creating a Java Compiler Plugin](http://www.baeldung.com/java-build-compiler-plugin) -- [Quick Guide to the Java Stack](http://www.baeldung.com/java-stack) +- [Quick Guide to the Java Stack](https://www.baeldung.com/java-stack) - [Compiling Java *.class Files with javac](http://www.baeldung.com/javac) - [Introduction to Javadoc](http://www.baeldung.com/javadoc) - [Guide to the Externalizable Interface in Java](http://www.baeldung.com/java-externalizable) From d2ede67d699c6ae635d74aa28698db75ab568d80 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 14:54:27 +0800 Subject: [PATCH 11/62] Update README.md --- persistence-modules/java-jpa-2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persistence-modules/java-jpa-2/README.md b/persistence-modules/java-jpa-2/README.md index 1c34ef2999..9d46c0d814 100644 --- a/persistence-modules/java-jpa-2/README.md +++ b/persistence-modules/java-jpa-2/README.md @@ -5,7 +5,7 @@ This module contains articles about the Java Persistence API (JPA) in Java. ### Relevant Articles - [JPA Query Parameters Usage](https://www.baeldung.com/jpa-query-parameters) -- [Mapping Entitiy Class Names to SQL Table Names with JPA](https://www.baeldung.com/jpa-entity-table-names) +- [Mapping Entity Class Names to SQL Table Names with JPA](https://www.baeldung.com/jpa-entity-table-names) - [Default Column Values in JPA](https://www.baeldung.com/jpa-default-column-values) - [Types of JPA Queries](https://www.baeldung.com/jpa-queries) - [JPA/Hibernate Projections](https://www.baeldung.com/jpa-hibernate-projections) From a555e0b020f8a18f9b2e3fac169b44b41b45cd9a Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 15:54:21 +0800 Subject: [PATCH 12/62] Update README.md --- persistence-modules/spring-persistence-simple/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/persistence-modules/spring-persistence-simple/README.md b/persistence-modules/spring-persistence-simple/README.md index db0d0ce83c..d665433eef 100644 --- a/persistence-modules/spring-persistence-simple/README.md +++ b/persistence-modules/spring-persistence-simple/README.md @@ -6,7 +6,7 @@ ### Relevant Articles: - [A Guide to JPA with Spring](https://www.baeldung.com/the-persistence-layer-with-spring-and-jpa) - [Bootstrapping Hibernate 5 with Spring](http://www.baeldung.com/hibernate-5-spring) -- [The DAO with Spring and Hibernate](http://www.baeldung.com/persistence-layer-with-spring-and-hibernate) +- [The DAO with Spring and Hibernate](https://www.baeldung.com/persistence-layer-with-spring-and-hibernate) - [Simplify the DAO with Spring and Java Generics](https://www.baeldung.com/simplifying-the-data-access-layer-with-spring-and-java-generics) - [Transactions with Spring and JPA](https://www.baeldung.com/transaction-configuration-with-jpa-and-spring) - [Introduction to Spring Data JPA](http://www.baeldung.com/the-persistence-layer-with-spring-data-jpa) From 94f2cceca320a0a8786cf56644b71251622c167f Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 16:41:44 +0800 Subject: [PATCH 13/62] Update README.md --- spring-scheduling/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-scheduling/README.md b/spring-scheduling/README.md index ddc540bafb..bf34fb60de 100644 --- a/spring-scheduling/README.md +++ b/spring-scheduling/README.md @@ -1,7 +1,7 @@ ### Relevant articles: -- [A Guide to the Spring Task Scheduler](http://www.baeldung.com/spring-task-scheduler) +- [A Guide to the Spring Task Scheduler](https://www.baeldung.com/spring-task-scheduler) - [The @Scheduled Annotation in Spring](https://www.baeldung.com/spring-scheduled-tasks) -- [Guide to Spring Retry](http://www.baeldung.com/spring-retry) -- [How To Do @Async in Spring](http://www.baeldung.com/spring-async) +- [Guide to Spring Retry](https://www.baeldung.com/spring-retry) +- [How To Do @Async in Spring](https://www.baeldung.com/spring-async) - [Conditionally Enable Scheduled Jobs in Spring](https://www.baeldung.com/spring-scheduled-enabled-conditionally) From ef33b57ac1d793ce965ee7c71a879d2a241c3da0 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:09:12 +0800 Subject: [PATCH 14/62] Update README.md --- maven-all/compiler-plugin-java-9/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maven-all/compiler-plugin-java-9/README.md b/maven-all/compiler-plugin-java-9/README.md index d0b7b72acc..0e02d56946 100644 --- a/maven-all/compiler-plugin-java-9/README.md +++ b/maven-all/compiler-plugin-java-9/README.md @@ -1,3 +1,3 @@ ### Relevant Articles -- [Maven Compiler Plugin](http://www.baeldung.com/maven-compiler-plugin) \ No newline at end of file +- [Maven Compiler Plugin](https://www.baeldung.com/maven-compiler-plugin) From ea6440d9d57604f9dc66161ea0e5c6548eb5a2ea Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:25:54 +0800 Subject: [PATCH 15/62] Update README.md --- spring-boot-modules/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-boot-modules/README.md b/spring-boot-modules/README.md index cd916f48a7..bb7c8b1688 100644 --- a/spring-boot-modules/README.md +++ b/spring-boot-modules/README.md @@ -1,3 +1,5 @@ ## Spring Boot Modules This module contains various modules of Spring Boot + +### Relevant Articles: From 2eb29cbeccf27c2310dd294d7021ab3d05713182 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:27:41 +0800 Subject: [PATCH 16/62] Update README.md --- spring-boot-modules/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/spring-boot-modules/README.md b/spring-boot-modules/README.md index bb7c8b1688..cd916f48a7 100644 --- a/spring-boot-modules/README.md +++ b/spring-boot-modules/README.md @@ -1,5 +1,3 @@ ## Spring Boot Modules This module contains various modules of Spring Boot - -### Relevant Articles: From a762d9c6757140ddc78f6816369405bbcc9904ac Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:30:27 +0800 Subject: [PATCH 17/62] Update README.md --- spring-boot-modules/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/spring-boot-modules/README.md b/spring-boot-modules/README.md index cd916f48a7..8b13789179 100644 --- a/spring-boot-modules/README.md +++ b/spring-boot-modules/README.md @@ -1,3 +1 @@ -## Spring Boot Modules -This module contains various modules of Spring Boot From 953b231114257156492ebb616f1670bf3f5906df Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:30:42 +0800 Subject: [PATCH 18/62] Delete README.md --- spring-boot-modules/README.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 spring-boot-modules/README.md diff --git a/spring-boot-modules/README.md b/spring-boot-modules/README.md deleted file mode 100644 index 8b13789179..0000000000 --- a/spring-boot-modules/README.md +++ /dev/null @@ -1 +0,0 @@ - From 78029ac429bf3d3c13cf53d097ce43b6b0a52764 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:35:52 +0800 Subject: [PATCH 19/62] Delete README.md --- core-java-modules/core-java-arrays-3/README.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 core-java-modules/core-java-arrays-3/README.md diff --git a/core-java-modules/core-java-arrays-3/README.md b/core-java-modules/core-java-arrays-3/README.md deleted file mode 100644 index 9f2885a2ce..0000000000 --- a/core-java-modules/core-java-arrays-3/README.md +++ /dev/null @@ -1,5 +0,0 @@ -## Core Java Arrays (Part 3) - -This module contains articles about Java arrays - -## Relevant Articles From 20090cf121771a96f1c6e67bef746ffed551e868 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:41:07 +0800 Subject: [PATCH 20/62] Update README.md --- apache-fop/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/apache-fop/README.md b/apache-fop/README.md index 2adc593026..8b13789179 100644 --- a/apache-fop/README.md +++ b/apache-fop/README.md @@ -1,5 +1 @@ -## Apache FOP -This module contains articles about Apache FOP - -### Relevant Articles: From 66720bc8a136f716de7aac71463812de7dbdd820 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:41:15 +0800 Subject: [PATCH 21/62] Delete README.md --- apache-fop/README.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 apache-fop/README.md diff --git a/apache-fop/README.md b/apache-fop/README.md deleted file mode 100644 index 8b13789179..0000000000 --- a/apache-fop/README.md +++ /dev/null @@ -1 +0,0 @@ - From a27bcff3a0713c625925a0516503369a42258876 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:43:25 +0800 Subject: [PATCH 22/62] Update README.md --- core-kotlin-modules/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core-kotlin-modules/README.md b/core-kotlin-modules/README.md index 974db9378a..8b13789179 100644 --- a/core-kotlin-modules/README.md +++ b/core-kotlin-modules/README.md @@ -1,5 +1 @@ -## Core Kotlin - -This module contains articles about core Kotlin. - From 0431d78a9f14e12276c06695eb73bf58df1bcc28 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Mon, 2 Mar 2020 18:43:33 +0800 Subject: [PATCH 23/62] Delete README.md --- core-kotlin-modules/README.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 core-kotlin-modules/README.md diff --git a/core-kotlin-modules/README.md b/core-kotlin-modules/README.md deleted file mode 100644 index 8b13789179..0000000000 --- a/core-kotlin-modules/README.md +++ /dev/null @@ -1 +0,0 @@ - From df85b0ef90a07f67165f6f3bf46fb31b53da6a6e Mon Sep 17 00:00:00 2001 From: dupirefr Date: Mon, 2 Mar 2020 23:45:09 +0100 Subject: [PATCH 24/62] [JAVA-130] Updated logback version from 1.1.7 to 1.2.3 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0bcfac7963..7e85982ba9 100644 --- a/pom.xml +++ b/pom.xml @@ -1338,7 +1338,7 @@ 1.7.30 - 1.1.7 + 1.2.3 From a3e0e8726b6ef5cd4290d860d40c49c5840c4876 Mon Sep 17 00:00:00 2001 From: dupirefr Date: Fri, 28 Feb 2020 07:51:15 +0100 Subject: [PATCH 25/62] [JAVA-131] Updated hamcrest version from 1.3 to 2.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0bcfac7963..ef9f0e1555 100644 --- a/pom.xml +++ b/pom.xml @@ -1333,7 +1333,7 @@ false 4.12 - 1.3 + 2.2 2.21.0 From 0a6ee0c79715b792ba01048a9a40dec5b9fd530d Mon Sep 17 00:00:00 2001 From: dupirefr Date: Fri, 28 Feb 2020 21:18:42 +0100 Subject: [PATCH 26/62] [JAVA-131] Kept difference between hamcrest and hamcrest-all --- cdi/pom.xml | 2 +- .../core-java-string-conversions-2/pom.xml | 2 +- core-java-modules/core-java-string-conversions/pom.xml | 2 +- .../core-java-string-operations-2/pom.xml | 2 +- ethereum/pom.xml | 2 +- pom.xml | 10 +++++----- testing-modules/selenium-junit-testng/pom.xml | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cdi/pom.xml b/cdi/pom.xml index 87ad9c111a..3387575254 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -27,7 +27,7 @@ org.hamcrest hamcrest-core - ${org.hamcrest.version} + ${hamcrest.version} test diff --git a/core-java-modules/core-java-string-conversions-2/pom.xml b/core-java-modules/core-java-string-conversions-2/pom.xml index 58b00b757a..0ac9a247fb 100644 --- a/core-java-modules/core-java-string-conversions-2/pom.xml +++ b/core-java-modules/core-java-string-conversions-2/pom.xml @@ -29,7 +29,7 @@ org.hamcrest hamcrest-library - ${org.hamcrest.version} + ${hamcrest.version} test diff --git a/core-java-modules/core-java-string-conversions/pom.xml b/core-java-modules/core-java-string-conversions/pom.xml index e3d6036e53..6d4cc02612 100644 --- a/core-java-modules/core-java-string-conversions/pom.xml +++ b/core-java-modules/core-java-string-conversions/pom.xml @@ -45,7 +45,7 @@ org.hamcrest hamcrest-library - ${org.hamcrest.version} + ${hamcrest.version} test diff --git a/core-java-modules/core-java-string-operations-2/pom.xml b/core-java-modules/core-java-string-operations-2/pom.xml index 7bb687ea2b..e900a17a30 100644 --- a/core-java-modules/core-java-string-operations-2/pom.xml +++ b/core-java-modules/core-java-string-operations-2/pom.xml @@ -49,7 +49,7 @@ org.hamcrest hamcrest-library - ${org.hamcrest.version} + ${hamcrest.version} test diff --git a/ethereum/pom.xml b/ethereum/pom.xml index 1449d9d95c..8e79d4a36a 100644 --- a/ethereum/pom.xml +++ b/ethereum/pom.xml @@ -160,7 +160,7 @@ org.hamcrest hamcrest-library - ${org.hamcrest.version} + ${hamcrest.version} test diff --git a/pom.xml b/pom.xml index ef9f0e1555..f64d34aa63 100644 --- a/pom.xml +++ b/pom.xml @@ -60,19 +60,19 @@ org.hamcrest hamcrest-core - ${org.hamcrest.version} + ${hamcrest.version} test org.hamcrest hamcrest-library - ${org.hamcrest.version} + ${hamcrest.version} test org.hamcrest hamcrest-all - ${org.hamcrest.version} + ${hamcrest-all.version} test @@ -1333,7 +1333,8 @@ false 4.12 - 2.2 + 2.2 + 1.3 2.21.0 @@ -1351,7 +1352,6 @@ 2.1.0.1 1.19 1.19 - 1.3 1.6.0 2.21.0 2.5 diff --git a/testing-modules/selenium-junit-testng/pom.xml b/testing-modules/selenium-junit-testng/pom.xml index 0616cdaa29..ea8603c698 100644 --- a/testing-modules/selenium-junit-testng/pom.xml +++ b/testing-modules/selenium-junit-testng/pom.xml @@ -38,7 +38,7 @@ org.hamcrest hamcrest-all - ${org.hamcrest.version} + ${hamcrest.version} From fa4898356b8c57e0142fa052bfb6cfa03b790774 Mon Sep 17 00:00:00 2001 From: dupirefr Date: Fri, 28 Feb 2020 21:27:12 +0100 Subject: [PATCH 27/62] [JAVA-131] Fixed hamcrest-all version in selenium module --- testing-modules/selenium-junit-testng/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing-modules/selenium-junit-testng/pom.xml b/testing-modules/selenium-junit-testng/pom.xml index ea8603c698..3734bf72c9 100644 --- a/testing-modules/selenium-junit-testng/pom.xml +++ b/testing-modules/selenium-junit-testng/pom.xml @@ -38,7 +38,7 @@ org.hamcrest hamcrest-all - ${hamcrest.version} + ${hamcrest-all.version} @@ -71,4 +71,4 @@ 3.4.0 - \ No newline at end of file + From 4d5e21b99191070e259eaeecdfc924e6ac473455 Mon Sep 17 00:00:00 2001 From: dupirefr Date: Sat, 29 Feb 2020 08:04:27 +0100 Subject: [PATCH 28/62] [JAVA-131] Removed unused version of java-hamcrest from mockito module --- testing-modules/mockito/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/testing-modules/mockito/pom.xml b/testing-modules/mockito/pom.xml index 0fb11d23ab..aae3981c66 100644 --- a/testing-modules/mockito/pom.xml +++ b/testing-modules/mockito/pom.xml @@ -90,7 +90,6 @@ 2.0.2 - 2.0.0.0 2.1.1 From 1cac276528cb07a23e65d4a0ee2dbf6e8794be67 Mon Sep 17 00:00:00 2001 From: dupirefr Date: Sun, 1 Mar 2020 10:48:45 +0100 Subject: [PATCH 29/62] [JAVA-131] Renaming java-hamcrest version property to avoid conflict with other hamcrest libraries --- testing-modules/hamcrest/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing-modules/hamcrest/pom.xml b/testing-modules/hamcrest/pom.xml index cfd5bf5fac..ec9177d8f2 100644 --- a/testing-modules/hamcrest/pom.xml +++ b/testing-modules/hamcrest/pom.xml @@ -18,13 +18,13 @@ org.hamcrest java-hamcrest - ${hamcrest.version} + ${java-hamcrest.version} test - 2.0.0.0 + 2.0.0.0 From 892ec576a2cf30465bd406d44ea705bdf3beceab Mon Sep 17 00:00:00 2001 From: dupirefr Date: Mon, 2 Mar 2020 23:12:11 +0100 Subject: [PATCH 30/62] [JAVA-131] Updated java-hamcrest version property in spring-testing module --- testing-modules/spring-testing/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing-modules/spring-testing/pom.xml b/testing-modules/spring-testing/pom.xml index 38e7a0dd46..c5e94f3afc 100644 --- a/testing-modules/spring-testing/pom.xml +++ b/testing-modules/spring-testing/pom.xml @@ -19,7 +19,7 @@ org.hamcrest java-hamcrest - ${hamcrest.version} + ${java-hamcrest.version} @@ -114,7 +114,7 @@ - 2.0.0.0 + 2.0.0.0 3.1.6 5.5.0 1.5.2 From cc79530c9c5ab40ae96b8cff68782839cf72651f Mon Sep 17 00:00:00 2001 From: dupirefr Date: Tue, 3 Mar 2020 07:06:06 +0100 Subject: [PATCH 31/62] [JAVA-131] Unifying hamcrest-core and hamcrest-libraries dependencies under hamcrest --- cdi/pom.xml | 2 +- core-java-modules/core-java-string-conversions-2/pom.xml | 2 +- core-java-modules/core-java-string-conversions/pom.xml | 2 +- core-java-modules/core-java-string-operations-2/pom.xml | 2 +- ethereum/pom.xml | 2 +- pom.xml | 8 +------- spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml | 2 +- spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml | 7 +------ spring-core-2/pom.xml | 7 +------ spring-rest-query-language/pom.xml | 8 +------- spring-rest-simple/pom.xml | 7 +------ spring-rest-testing/pom.xml | 7 +------ spring-resttemplate/pom.xml | 7 +------ .../spring-security-cache-control/pom.xml | 7 +------ .../spring-security-mvc-boot-1/pom.xml | 7 +------ .../spring-security-mvc-boot-2/pom.xml | 7 +------ .../spring-security-rest-custom/pom.xml | 7 +------ 17 files changed, 17 insertions(+), 74 deletions(-) diff --git a/cdi/pom.xml b/cdi/pom.xml index 3387575254..32b9c8a360 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -26,7 +26,7 @@ org.hamcrest - hamcrest-core + hamcrest ${hamcrest.version} test diff --git a/core-java-modules/core-java-string-conversions-2/pom.xml b/core-java-modules/core-java-string-conversions-2/pom.xml index 0ac9a247fb..9f2276b212 100644 --- a/core-java-modules/core-java-string-conversions-2/pom.xml +++ b/core-java-modules/core-java-string-conversions-2/pom.xml @@ -28,7 +28,7 @@ org.hamcrest - hamcrest-library + hamcrest ${hamcrest.version} test diff --git a/core-java-modules/core-java-string-conversions/pom.xml b/core-java-modules/core-java-string-conversions/pom.xml index 6d4cc02612..7f8fe6468f 100644 --- a/core-java-modules/core-java-string-conversions/pom.xml +++ b/core-java-modules/core-java-string-conversions/pom.xml @@ -44,7 +44,7 @@ org.hamcrest - hamcrest-library + hamcrest ${hamcrest.version} test diff --git a/core-java-modules/core-java-string-operations-2/pom.xml b/core-java-modules/core-java-string-operations-2/pom.xml index e900a17a30..b882e499b2 100644 --- a/core-java-modules/core-java-string-operations-2/pom.xml +++ b/core-java-modules/core-java-string-operations-2/pom.xml @@ -48,7 +48,7 @@ org.hamcrest - hamcrest-library + hamcrest ${hamcrest.version} test diff --git a/ethereum/pom.xml b/ethereum/pom.xml index 8e79d4a36a..8c7e4c8c4c 100644 --- a/ethereum/pom.xml +++ b/ethereum/pom.xml @@ -159,7 +159,7 @@ org.hamcrest - hamcrest-library + hamcrest ${hamcrest.version} test diff --git a/pom.xml b/pom.xml index f64d34aa63..bdcd7724b5 100644 --- a/pom.xml +++ b/pom.xml @@ -59,13 +59,7 @@ org.hamcrest - hamcrest-core - ${hamcrest.version} - test - - - org.hamcrest - hamcrest-library + hamcrest ${hamcrest.version} test diff --git a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml index fd524a1a4a..67df052911 100644 --- a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml @@ -64,7 +64,7 @@ org.hamcrest - hamcrest-core + hamcrest ${hamcrest.version} test diff --git a/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml b/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml index 09c94663b1..7978d9c77b 100644 --- a/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml +++ b/spring-cloud/spring-cloud-zuul/spring-zuul-ui/pom.xml @@ -24,12 +24,7 @@ org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library + hamcrest test diff --git a/spring-core-2/pom.xml b/spring-core-2/pom.xml index 4d474d8b2c..edbb351bd0 100644 --- a/spring-core-2/pom.xml +++ b/spring-core-2/pom.xml @@ -135,12 +135,7 @@ org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library + hamcrest test diff --git a/spring-rest-query-language/pom.xml b/spring-rest-query-language/pom.xml index 25b149367e..2423528743 100644 --- a/spring-rest-query-language/pom.xml +++ b/spring-rest-query-language/pom.xml @@ -206,15 +206,9 @@ test - - - - - - org.hamcrest - hamcrest-library + hamcrest test diff --git a/spring-rest-simple/pom.xml b/spring-rest-simple/pom.xml index 59f7a94b8d..291053c87f 100644 --- a/spring-rest-simple/pom.xml +++ b/spring-rest-simple/pom.xml @@ -139,12 +139,7 @@ org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library + hamcrest test diff --git a/spring-rest-testing/pom.xml b/spring-rest-testing/pom.xml index dcd8b677be..d807459cad 100644 --- a/spring-rest-testing/pom.xml +++ b/spring-rest-testing/pom.xml @@ -177,14 +177,9 @@ test - - - - - org.hamcrest - hamcrest-library + hamcrest test diff --git a/spring-resttemplate/pom.xml b/spring-resttemplate/pom.xml index 138fde3b45..05660f5210 100644 --- a/spring-resttemplate/pom.xml +++ b/spring-resttemplate/pom.xml @@ -130,12 +130,7 @@ org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library + hamcrest test diff --git a/spring-security-modules/spring-security-cache-control/pom.xml b/spring-security-modules/spring-security-cache-control/pom.xml index ff96ae78dd..d8a4839991 100644 --- a/spring-security-modules/spring-security-cache-control/pom.xml +++ b/spring-security-modules/spring-security-cache-control/pom.xml @@ -42,12 +42,7 @@ org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library + hamcrest test diff --git a/spring-security-modules/spring-security-mvc-boot-1/pom.xml b/spring-security-modules/spring-security-mvc-boot-1/pom.xml index 3eeac80d2c..7dfee200d4 100644 --- a/spring-security-modules/spring-security-mvc-boot-1/pom.xml +++ b/spring-security-modules/spring-security-mvc-boot-1/pom.xml @@ -61,12 +61,7 @@ org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library + hamcrest test diff --git a/spring-security-modules/spring-security-mvc-boot-2/pom.xml b/spring-security-modules/spring-security-mvc-boot-2/pom.xml index fca38b9714..565528e070 100644 --- a/spring-security-modules/spring-security-mvc-boot-2/pom.xml +++ b/spring-security-modules/spring-security-mvc-boot-2/pom.xml @@ -61,12 +61,7 @@ org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library + hamcrest test diff --git a/spring-security-modules/spring-security-rest-custom/pom.xml b/spring-security-modules/spring-security-rest-custom/pom.xml index d9072ec8a2..b4f0f93bb6 100644 --- a/spring-security-modules/spring-security-rest-custom/pom.xml +++ b/spring-security-modules/spring-security-rest-custom/pom.xml @@ -136,12 +136,7 @@ org.hamcrest - hamcrest-core - test - - - org.hamcrest - hamcrest-library + hamcrest test From 083d80287935de6e7632166dc8879723ab21f59b Mon Sep 17 00:00:00 2001 From: dupirefr Date: Tue, 3 Mar 2020 07:41:32 +0100 Subject: [PATCH 32/62] [JAVA-131] Giving version to hamcrest library in spring-security-modules --- spring-security-modules/spring-security-cache-control/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-security-modules/spring-security-cache-control/pom.xml b/spring-security-modules/spring-security-cache-control/pom.xml index d8a4839991..acc37b41ef 100644 --- a/spring-security-modules/spring-security-cache-control/pom.xml +++ b/spring-security-modules/spring-security-cache-control/pom.xml @@ -43,6 +43,7 @@ org.hamcrest hamcrest + ${hamcrest.version} test From f881a11e439655ef67b4f8a3f8064115cdf6c883 Mon Sep 17 00:00:00 2001 From: dupirefr Date: Thu, 5 Mar 2020 07:57:56 +0100 Subject: [PATCH 33/62] [JAVA-131] Reverted hamcrest to hamcrest-core because version used is 1.3 in Greetings module --- spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml index 67df052911..d5d89c2ec4 100644 --- a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml @@ -64,7 +64,7 @@ org.hamcrest - hamcrest + hamcrest-core ${hamcrest.version} test @@ -75,4 +75,4 @@ 1.3 - \ No newline at end of file + From bc2c937183df9a66df534f7aa1e3d7f2f4e7aa76 Mon Sep 17 00:00:00 2001 From: dupirefr Date: Thu, 5 Mar 2020 08:08:43 +0100 Subject: [PATCH 34/62] [JAVA-131] Renaming the property works better --- spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml index d5d89c2ec4..ac469d8bc4 100644 --- a/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml +++ b/spring-cloud/spring-cloud-zookeeper/Greeting/pom.xml @@ -65,14 +65,14 @@ org.hamcrest hamcrest-core - ${hamcrest.version} + ${hamcrest-core.version} test 1.2.5.RELEASE - 1.3 + 1.3 From f7a449978ca66a52a5a67289843aa2ba4aedde5c Mon Sep 17 00:00:00 2001 From: mthomas Date: Thu, 5 Mar 2020 02:04:22 -0600 Subject: [PATCH 35/62] BAEL-2552 - Add controller and unit test showing how to set timeouts --- .../serverconfig/TimeoutController.java | 23 +++++ .../spring/serverconfig/TimeoutLiveTest.java | 88 +++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 spring-5-webflux/src/main/java/com/baeldung/spring/serverconfig/TimeoutController.java create mode 100644 spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java diff --git a/spring-5-webflux/src/main/java/com/baeldung/spring/serverconfig/TimeoutController.java b/spring-5-webflux/src/main/java/com/baeldung/spring/serverconfig/TimeoutController.java new file mode 100644 index 0000000000..a4cd6bd6ba --- /dev/null +++ b/spring-5-webflux/src/main/java/com/baeldung/spring/serverconfig/TimeoutController.java @@ -0,0 +1,23 @@ +package com.baeldung.spring.serverconfig; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import reactor.core.publisher.Mono; + +@RestController +@RequestMapping("/timeout") +public class TimeoutController { + + @GetMapping("/{timeout}") + private Mono timeout(@PathVariable int timeout) { + try { + Thread.sleep(timeout * 1000); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + return Mono.just("OK"); + } +} diff --git a/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java b/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java new file mode 100644 index 0000000000..09d8032d41 --- /dev/null +++ b/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java @@ -0,0 +1,88 @@ +package com.baeldung.spring.serverconfig; + +import java.util.concurrent.TimeUnit; + +import javax.net.ssl.SSLException; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; +import org.springframework.http.client.reactive.ReactorClientHttpConnector; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.test.web.reactive.server.WebTestClient; + +import io.netty.channel.ChannelOption; +import io.netty.handler.ssl.SslContext; +import io.netty.handler.ssl.SslContextBuilder; +import io.netty.handler.ssl.util.InsecureTrustManagerFactory; +import io.netty.handler.timeout.ReadTimeoutException; +import io.netty.handler.timeout.ReadTimeoutHandler; +import io.netty.handler.timeout.WriteTimeoutHandler; +import reactor.netty.http.client.HttpClient; +import reactor.netty.tcp.TcpClient; + +@RunWith(SpringRunner.class) +@SpringBootTest(webEnvironment = WebEnvironment.DEFINED_PORT) +@DirtiesContext +public class TimeoutLiveTest { + + private static final String BASE_URL = "https://localhost:8443"; + private static final int TIMEOUT_MILLIS = 2000; + + private WebTestClient webTestClient; + + @Before + public void setup() throws SSLException { + webTestClient = WebTestClient.bindToServer(getConnector()) + .baseUrl(BASE_URL) + .build(); + } + + @Test + public void shouldTimeout() { + try { + webTestClient.get() + .uri("/timeout/{timeout}", 3) + .exchange(); + Assert.fail(); + } catch (ReadTimeoutException ignore) { + } + } + + @Test + public void shouldNotTimeout() { + try { + WebTestClient.ResponseSpec response = webTestClient.get() + .uri("/timeout/{timeout}", 1) + .exchange(); + response.expectStatus() + .isOk() + .expectBody(String.class) + .isEqualTo("OK"); + } catch (ReadTimeoutException e) { + Assert.fail(); + } + } + + private ReactorClientHttpConnector getConnector() throws SSLException { + SslContext sslContext = SslContextBuilder + .forClient() + .trustManager(InsecureTrustManagerFactory.INSTANCE) + .build(); + + TcpClient tcpClient = TcpClient + .create() + .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, TIMEOUT_MILLIS) + .doOnConnected(connection -> { + connection.addHandlerLast(new ReadTimeoutHandler(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)); + connection.addHandlerLast(new WriteTimeoutHandler(TIMEOUT_MILLIS, TimeUnit.MILLISECONDS)); + }); + + HttpClient httpClient = HttpClient.from(tcpClient).secure(t -> t.sslContext(sslContext)); + return new ReactorClientHttpConnector(httpClient); + } +} From f37bb67f4c16635d2c50e21e89df76f0172e27c9 Mon Sep 17 00:00:00 2001 From: mthomas Date: Thu, 5 Mar 2020 11:47:04 -0600 Subject: [PATCH 36/62] BAEL-2552 - use JUnit @Rule --- .../spring/serverconfig/TimeoutLiveTest.java | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java b/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java index 09d8032d41..78e61dce5f 100644 --- a/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java +++ b/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java @@ -6,7 +6,9 @@ import javax.net.ssl.SSLException; import org.junit.Assert; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; @@ -35,6 +37,9 @@ public class TimeoutLiveTest { private WebTestClient webTestClient; + @Rule + public ExpectedException exception = ExpectedException.none(); + @Before public void setup() throws SSLException { webTestClient = WebTestClient.bindToServer(getConnector()) @@ -44,28 +49,22 @@ public class TimeoutLiveTest { @Test public void shouldTimeout() { - try { - webTestClient.get() - .uri("/timeout/{timeout}", 3) - .exchange(); - Assert.fail(); - } catch (ReadTimeoutException ignore) { - } + exception.expect(ReadTimeoutException.class); + webTestClient.get() + .uri("/timeout/{timeout}", 3) + .exchange(); + Assert.fail(); } @Test public void shouldNotTimeout() { - try { - WebTestClient.ResponseSpec response = webTestClient.get() - .uri("/timeout/{timeout}", 1) - .exchange(); - response.expectStatus() - .isOk() - .expectBody(String.class) - .isEqualTo("OK"); - } catch (ReadTimeoutException e) { - Assert.fail(); - } + WebTestClient.ResponseSpec response = webTestClient.get() + .uri("/timeout/{timeout}", 1) + .exchange(); + response.expectStatus() + .isOk() + .expectBody(String.class) + .isEqualTo("OK"); } private ReactorClientHttpConnector getConnector() throws SSLException { From 50ea6a8d9add511ec0e03ab21b0ba2b0e3c21297 Mon Sep 17 00:00:00 2001 From: mthomas Date: Thu, 5 Mar 2020 12:13:08 -0600 Subject: [PATCH 37/62] BAEL-2552 - Remove unnecessary line --- .../java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java b/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java index 78e61dce5f..c53fd4fa80 100644 --- a/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java +++ b/spring-5-webflux/src/test/java/com/baeldung/spring/serverconfig/TimeoutLiveTest.java @@ -4,7 +4,6 @@ import java.util.concurrent.TimeUnit; import javax.net.ssl.SSLException; -import org.junit.Assert; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -53,7 +52,6 @@ public class TimeoutLiveTest { webTestClient.get() .uri("/timeout/{timeout}", 3) .exchange(); - Assert.fail(); } @Test From 4739f9c929a7159f578dbb344f5a1d0aed18cb54 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 10:51:38 +0800 Subject: [PATCH 38/62] Update README.md --- oauth2-framework-impl/oauth2-client/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/oauth2-framework-impl/oauth2-client/README.md b/oauth2-framework-impl/oauth2-client/README.md index 4bcb9790b1..8b13789179 100644 --- a/oauth2-framework-impl/oauth2-client/README.md +++ b/oauth2-framework-impl/oauth2-client/README.md @@ -1,3 +1 @@ -### Relevant Articles: -- [Implementing The OAuth 2.0 Authorization Framework Using Jakarta EE](https://www.baeldung.com/java-ee-oauth2-implementation) From 0bb6e9f79aef5f96abac00e8bae07abdb0f1fa4f Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 10:51:46 +0800 Subject: [PATCH 39/62] Delete README.md --- oauth2-framework-impl/oauth2-client/README.md | 1 - 1 file changed, 1 deletion(-) delete mode 100644 oauth2-framework-impl/oauth2-client/README.md diff --git a/oauth2-framework-impl/oauth2-client/README.md b/oauth2-framework-impl/oauth2-client/README.md deleted file mode 100644 index 8b13789179..0000000000 --- a/oauth2-framework-impl/oauth2-client/README.md +++ /dev/null @@ -1 +0,0 @@ - From 9693040b3843e3940c04bd58dd4214af4304705e Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 11:01:02 +0800 Subject: [PATCH 40/62] Update README.md --- testing-modules/testing-libraries/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/testing-modules/testing-libraries/README.md b/testing-modules/testing-libraries/README.md index b5360bd841..b1e1575e63 100644 --- a/testing-modules/testing-libraries/README.md +++ b/testing-modules/testing-libraries/README.md @@ -5,7 +5,6 @@ - [Intro to JaCoCo](http://www.baeldung.com/jacoco) - [Cucumber and Scenario Outline](http://www.baeldung.com/cucumber-scenario-outline) - [Cucumber Java 8 Support](http://www.baeldung.com/cucumber-java-8-support) -- [Introduction to Lambda Behave](http://www.baeldung.com/lambda-behave) - [Introduction to CheckStyle](https://www.baeldung.com/checkstyle-java) - [Introduction to FindBugs](https://www.baeldung.com/intro-to-findbugs) - [Cucumber Data Tables](https://www.baeldung.com/cucumber-data-tables) From c0363dea2ac5b99fc583b3b245347bba9e9f791d Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 11:03:19 +0800 Subject: [PATCH 41/62] Delete README.md --- .../spring-boot-runtime/disabling-console-logback/README.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 spring-boot-modules/spring-boot-runtime/disabling-console-logback/README.md diff --git a/spring-boot-modules/spring-boot-runtime/disabling-console-logback/README.md b/spring-boot-modules/spring-boot-runtime/disabling-console-logback/README.md deleted file mode 100644 index 554f051b41..0000000000 --- a/spring-boot-modules/spring-boot-runtime/disabling-console-logback/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles: - -- [How to Disable Console Logging in Spring Boot](https://www.baeldung.com/spring-boot-disable-console-logging) From 9d893422975e99ec47801fd5217b5a0dc3b29ac4 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 11:04:41 +0800 Subject: [PATCH 42/62] Update README.md --- maven-java-11/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/maven-java-11/README.md b/maven-java-11/README.md index fcb6ea3f06..b923518825 100644 --- a/maven-java-11/README.md +++ b/maven-java-11/README.md @@ -4,4 +4,3 @@ This module contains articles about Maven with Java 11+. ### Relevant Articles: -- [Multi-Module Maven Application with Java Modules](https://www.baeldung.com/maven-multi-module-project-java-jpms) From 696eaa8666b8ae281136ce15efc4d934b6c3f385 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 11:06:09 +0800 Subject: [PATCH 43/62] Update README.md --- core-java-modules/core-java-8-2/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-java-modules/core-java-8-2/README.md b/core-java-modules/core-java-8-2/README.md index 3d38fbbdbc..961941aac7 100644 --- a/core-java-modules/core-java-8-2/README.md +++ b/core-java-modules/core-java-8-2/README.md @@ -3,7 +3,7 @@ This module contains articles about Java 8 core features ### Relevant Articles: -- [Anonymous Classes in Java](https://www.baeldung.com/java-anonymous-classes) + - [How to Delay Code Execution in Java](https://www.baeldung.com/java-delay-code-execution) - [Run a Java Application from the Command Line](https://www.baeldung.com/java-run-jar-with-arguments) - [Java 8 Stream skip() vs limit()](https://www.baeldung.com/java-stream-skip-vs-limit) From 7ade5a3abfb2fb154323297d06d55cb34ebd5c73 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 11:11:01 +0800 Subject: [PATCH 44/62] Update README.md --- core-java-modules/core-java-lang-math/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/core-java-modules/core-java-lang-math/README.md b/core-java-modules/core-java-lang-math/README.md index ec97a2ada4..05526dfbc8 100644 --- a/core-java-modules/core-java-lang-math/README.md +++ b/core-java-modules/core-java-lang-math/README.md @@ -6,7 +6,6 @@ - [Java 8 Math New Methods](https://www.baeldung.com/java-8-math) - [Java 8 Unsigned Arithmetic Support](https://www.baeldung.com/java-unsigned-arithmetic) - [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts) -- [The strictfp Keyword in Java](https://www.baeldung.com/java-strictfp) - [Basic Calculator in Java](https://www.baeldung.com/java-basic-calculator) - [Overflow and Underflow in Java](https://www.baeldung.com/java-overflow-underflow) - [Obtaining a Power Set of a Set in Java](https://www.baeldung.com/java-power-set-of-a-set) From 7e829a4ab86bcad14b62047b367d4ed863c9e25d Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 11:11:41 +0800 Subject: [PATCH 45/62] Update README.md --- core-java-modules/core-java-lang-math/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/core-java-modules/core-java-lang-math/README.md b/core-java-modules/core-java-lang-math/README.md index 05526dfbc8..ec97a2ada4 100644 --- a/core-java-modules/core-java-lang-math/README.md +++ b/core-java-modules/core-java-lang-math/README.md @@ -6,6 +6,7 @@ - [Java 8 Math New Methods](https://www.baeldung.com/java-8-math) - [Java 8 Unsigned Arithmetic Support](https://www.baeldung.com/java-unsigned-arithmetic) - [How to Separate Double into Integer and Decimal Parts](https://www.baeldung.com/java-separate-double-into-integer-decimal-parts) +- [The strictfp Keyword in Java](https://www.baeldung.com/java-strictfp) - [Basic Calculator in Java](https://www.baeldung.com/java-basic-calculator) - [Overflow and Underflow in Java](https://www.baeldung.com/java-overflow-underflow) - [Obtaining a Power Set of a Set in Java](https://www.baeldung.com/java-power-set-of-a-set) From fad6088b0dc1280cde1c11f2b05787efa41b6fcc Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 11:12:26 +0800 Subject: [PATCH 46/62] Delete README.md --- apache-cxf/cxf-aegis/README.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 apache-cxf/cxf-aegis/README.md diff --git a/apache-cxf/cxf-aegis/README.md b/apache-cxf/cxf-aegis/README.md deleted file mode 100644 index e055826554..0000000000 --- a/apache-cxf/cxf-aegis/README.md +++ /dev/null @@ -1,3 +0,0 @@ -### Relevant Articles - -- [Introduction to Apache CXF Aegis Data Binding](https://www.baeldung.com/aegis-data-binding-in-apache-cxf) From 626fda4b64179ba13fdef90e6016d74164c7fe3a Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 11:13:37 +0800 Subject: [PATCH 47/62] Update README.md --- apache-olingo/olingo2/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/apache-olingo/olingo2/README.md b/apache-olingo/olingo2/README.md index b1cb23d822..826cd0133e 100644 --- a/apache-olingo/olingo2/README.md +++ b/apache-olingo/olingo2/README.md @@ -1,4 +1,3 @@ ### Relevant Articles: -- [OData Protocol Guide](https://www.baeldung.com/odata) - [Intro to OData with Olingo](https://www.baeldung.com/olingo) From 180ab967fbf21c49b11b19ef717dd0042f9bfaf9 Mon Sep 17 00:00:00 2001 From: johnA1331 <53036378+johnA1331@users.noreply.github.com> Date: Sat, 7 Mar 2020 11:15:18 +0800 Subject: [PATCH 48/62] Update README.md --- algorithms-miscellaneous-5/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/algorithms-miscellaneous-5/README.md b/algorithms-miscellaneous-5/README.md index 4ef919b33b..87a328e446 100644 --- a/algorithms-miscellaneous-5/README.md +++ b/algorithms-miscellaneous-5/README.md @@ -10,7 +10,6 @@ This module contains articles about algorithms. Some classes of algorithms, e.g. - [Find If Two Numbers Are Relatively Prime in Java](https://www.baeldung.com/java-two-relatively-prime-numbers) - [Knapsack Problem Implementation in Java](https://www.baeldung.com/java-knapsack) - [How to Determine if a Binary Tree is Balanced](https://www.baeldung.com/java-balanced-binary-tree) -- [The Caesar Cipher in Java](https://www.baeldung.com/java-caesar-cipher) - [Overview of Combinatorial Problems in Java](https://www.baeldung.com/java-combinatorial-algorithms) - [Prim’s Algorithm](https://www.baeldung.com/java-prim-algorithm) - [Maximum Subarray Problem](https://www.baeldung.com/java-maximum-subarray) From fb515ed6515e1d9989b01e95508961c142f70ab8 Mon Sep 17 00:00:00 2001 From: "amit.pandey" Date: Sat, 7 Mar 2020 16:25:11 +0530 Subject: [PATCH 49/62] fix relative path warning --- spring-boot-modules/spring-boot-logging-log4j2/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/spring-boot-modules/spring-boot-logging-log4j2/pom.xml b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml index 6e709230dd..00f830830a 100644 --- a/spring-boot-modules/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml @@ -13,6 +13,7 @@ org.springframework.boot spring-boot-starter-parent 2.2.2.RELEASE + From aaa6b73c3fb028ab9b77228014a70e75475eba5b Mon Sep 17 00:00:00 2001 From: "amit.pandey" Date: Sat, 7 Mar 2020 16:40:44 +0530 Subject: [PATCH 50/62] fix relative path warning. removed tab characters --- spring-boot-modules/spring-boot-logging-log4j2/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-modules/spring-boot-logging-log4j2/pom.xml b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml index 00f830830a..4422405187 100644 --- a/spring-boot-modules/spring-boot-logging-log4j2/pom.xml +++ b/spring-boot-modules/spring-boot-logging-log4j2/pom.xml @@ -13,7 +13,7 @@ org.springframework.boot spring-boot-starter-parent 2.2.2.RELEASE - + From 72d0f14b6edc6da177495398ddbc7680f9b1642f Mon Sep 17 00:00:00 2001 From: George Haris <40850523+gecharita@users.noreply.github.com> Date: Sat, 7 Mar 2020 16:16:08 +0200 Subject: [PATCH 51/62] BAEL-3835: Inject a value to a static field (#8820) Co-authored-by: Georgios Charitakis --- .../static-value-injection/README.md | 22 ++++++++ spring-core-3/static-value-injection/pom.xml | 52 +++++++++++++++++++ .../main/java/com/baeldung/Application.java | 13 +++++ .../controller/PropertyController.java | 31 +++++++++++ .../src/main/resources/application.properties | 1 + .../java/com/baeldung/ApplicationTests.java | 13 +++++ 6 files changed, 132 insertions(+) create mode 100644 spring-core-3/static-value-injection/README.md create mode 100644 spring-core-3/static-value-injection/pom.xml create mode 100644 spring-core-3/static-value-injection/src/main/java/com/baeldung/Application.java create mode 100644 spring-core-3/static-value-injection/src/main/java/com/baeldung/controller/PropertyController.java create mode 100644 spring-core-3/static-value-injection/src/main/resources/application.properties create mode 100644 spring-core-3/static-value-injection/src/test/java/com/baeldung/ApplicationTests.java diff --git a/spring-core-3/static-value-injection/README.md b/spring-core-3/static-value-injection/README.md new file mode 100644 index 0000000000..06dfa29f80 --- /dev/null +++ b/spring-core-3/static-value-injection/README.md @@ -0,0 +1,22 @@ +# Inject a value to a static field + +## How to run +```sh +mvn clean install +mvn spring-boot:run +``` + +## Request + +**GET** +http://localhost:8080/properties + + +## Response +```json +[ + "Inject a value to a static field", + "Inject a value to a static field", + null +] +``` diff --git a/spring-core-3/static-value-injection/pom.xml b/spring-core-3/static-value-injection/pom.xml new file mode 100644 index 0000000000..aa45fde886 --- /dev/null +++ b/spring-core-3/static-value-injection/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.2.4.RELEASE + + + com.baeldung + static.value.injection + 0.0.1-SNAPSHOT + static.value.injection + Demo project for Spring Boot + + + 1.8 + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/spring-core-3/static-value-injection/src/main/java/com/baeldung/Application.java b/spring-core-3/static-value-injection/src/main/java/com/baeldung/Application.java new file mode 100644 index 0000000000..c1875216b5 --- /dev/null +++ b/spring-core-3/static-value-injection/src/main/java/com/baeldung/Application.java @@ -0,0 +1,13 @@ +package com.baeldung; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class Application { + + public static void main(String[] args) { + SpringApplication.run(Application.class, args); + } + +} diff --git a/spring-core-3/static-value-injection/src/main/java/com/baeldung/controller/PropertyController.java b/spring-core-3/static-value-injection/src/main/java/com/baeldung/controller/PropertyController.java new file mode 100644 index 0000000000..03a2518117 --- /dev/null +++ b/spring-core-3/static-value-injection/src/main/java/com/baeldung/controller/PropertyController.java @@ -0,0 +1,31 @@ +package com.baeldung.controller; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Arrays; +import java.util.List; + +@RestController +public class PropertyController { + + @Value("${name}") + private String name; + + @Value("${name}") + private static String NAME_NULL; + + private static String NAME_STATIC; + + @Value("${name}") + public void setNameStatic(String name){ + PropertyController.NAME_STATIC = name; + } + + @GetMapping("/properties") + public List getProperties(){ + return Arrays.asList(this.name, NAME_STATIC, NAME_NULL) ; + } +} diff --git a/spring-core-3/static-value-injection/src/main/resources/application.properties b/spring-core-3/static-value-injection/src/main/resources/application.properties new file mode 100644 index 0000000000..828fa9cd2a --- /dev/null +++ b/spring-core-3/static-value-injection/src/main/resources/application.properties @@ -0,0 +1 @@ +name = Inject a value to a static field diff --git a/spring-core-3/static-value-injection/src/test/java/com/baeldung/ApplicationTests.java b/spring-core-3/static-value-injection/src/test/java/com/baeldung/ApplicationTests.java new file mode 100644 index 0000000000..4ad83bc539 --- /dev/null +++ b/spring-core-3/static-value-injection/src/test/java/com/baeldung/ApplicationTests.java @@ -0,0 +1,13 @@ +package com.baeldung; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class ApplicationTests { + + @Test + void contextLoads() { + } + +} From ce75bc8ddf1ffa1857532c0f5db9aede62d3347a Mon Sep 17 00:00:00 2001 From: Ashley Frieze Date: Sun, 1 Mar 2020 00:38:42 +0000 Subject: [PATCH 52/62] BAEL-3905 - replacing tokens tests and implementation --- core-java-modules/core-java-regex/pom.xml | 6 ++ .../replacetokens/ReplacingTokens.java | 63 +++++++++++++++ .../ReplacingTokensUnitTest.java | 79 +++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 core-java-modules/core-java-regex/src/main/java/com/baeldung/replacetokens/ReplacingTokens.java create mode 100644 core-java-modules/core-java-regex/src/test/java/com/baeldung/replacetokens/ReplacingTokensUnitTest.java diff --git a/core-java-modules/core-java-regex/pom.xml b/core-java-modules/core-java-regex/pom.xml index 129b6039cd..1c55177d70 100644 --- a/core-java-modules/core-java-regex/pom.xml +++ b/core-java-modules/core-java-regex/pom.xml @@ -25,6 +25,12 @@ jmh-generator-annprocess ${jmh-core.version} + + org.assertj + assertj-core + 3.15.0 + test + diff --git a/core-java-modules/core-java-regex/src/main/java/com/baeldung/replacetokens/ReplacingTokens.java b/core-java-modules/core-java-regex/src/main/java/com/baeldung/replacetokens/ReplacingTokens.java new file mode 100644 index 0000000000..a4774ad572 --- /dev/null +++ b/core-java-modules/core-java-regex/src/main/java/com/baeldung/replacetokens/ReplacingTokens.java @@ -0,0 +1,63 @@ +package com.baeldung.replacetokens; + +import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ReplacingTokens { + public static final Pattern TITLE_CASE_PATTERN = Pattern.compile("(?<=^|[^A-Za-z])([A-Z][a-z]*)(?=[^A-Za-z]|$)"); + + /** + * Iterate over the title case tokens in the input and replace them with lowercase + * @param original the original string + * @return a string with words replaced with their lowercase equivalents + */ + public static String replaceTitleCaseWithLowerCase(String original) { + int lastIndex = 0; + StringBuilder output = new StringBuilder(); + Matcher matcher = TITLE_CASE_PATTERN.matcher(original); + while (matcher.find()) { + output.append(original, lastIndex, matcher.start()) + .append(convert(matcher.group(1))); + + lastIndex = matcher.end(); + } + if (lastIndex < original.length()) { + output.append(original, lastIndex, original.length()); + } + return output.toString(); + } + + /** + * Convert a token found into its desired lowercase + * @param token the token to convert + * @return the converted token + */ + private static String convert(String token) { + return token.toLowerCase(); + } + + /** + * Replace all the tokens in an input using the algorithm provided for each + * @param original original string + * @param tokenPattern the pattern to match with + * @param converter the conversion to apply + * @return the substituted string + */ + public static String replaceTokens(String original, Pattern tokenPattern, + Function converter) { + int lastIndex = 0; + StringBuilder output = new StringBuilder(); + Matcher matcher = tokenPattern.matcher(original); + while (matcher.find()) { + output.append(original, lastIndex, matcher.start()) + .append(converter.apply(matcher)); + + lastIndex = matcher.end(); + } + if (lastIndex < original.length()) { + output.append(original, lastIndex, original.length()); + } + return output.toString(); + } +} diff --git a/core-java-modules/core-java-regex/src/test/java/com/baeldung/replacetokens/ReplacingTokensUnitTest.java b/core-java-modules/core-java-regex/src/test/java/com/baeldung/replacetokens/ReplacingTokensUnitTest.java new file mode 100644 index 0000000000..b42a17f88e --- /dev/null +++ b/core-java-modules/core-java-regex/src/test/java/com/baeldung/replacetokens/ReplacingTokensUnitTest.java @@ -0,0 +1,79 @@ +package com.baeldung.replacetokens; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static com.baeldung.replacetokens.ReplacingTokens.TITLE_CASE_PATTERN; +import static com.baeldung.replacetokens.ReplacingTokens.replaceTokens; +import static org.assertj.core.api.Assertions.assertThat; + +public class ReplacingTokensUnitTest { + private static final String EXAMPLE_INPUT = "First 3 Capital Words! then 10 TLAs, I Found"; + private static final String EXAMPLE_INPUT_PROCESSED = "first 3 capital words! then 10 TLAs, i found"; + + @Test + public void whenFindMatches_thenTitleWordsFound() { + Matcher matcher = TITLE_CASE_PATTERN.matcher(EXAMPLE_INPUT); + List matches = new ArrayList<>(); + while (matcher.find()) { + matches.add(matcher.group(1)); + } + + assertThat(matches) + .containsExactly("First", "Capital", "Words", "I", "Found"); + } + + @Test + public void exploreMatches() { + Matcher matcher = TITLE_CASE_PATTERN.matcher(EXAMPLE_INPUT); + while (matcher.find()) { + System.out.println("Match: " + matcher.group(0)); + System.out.println("Start: " + matcher.start()); + System.out.println("End: " + matcher.end()); + } + } + + @Test + public void whenReplaceTokensWithLowerCase() { + assertThat(ReplacingTokens.replaceTitleCaseWithLowerCase(EXAMPLE_INPUT)) + .isEqualTo(EXAMPLE_INPUT_PROCESSED); + } + + @Test + public void whenReplaceTokensWithLowerCaseUsingGeneralPurpose() { + assertThat(replaceTokens("First 3 Capital Words! then 10 TLAs, I Found", + TITLE_CASE_PATTERN, + match -> match.group(1).toLowerCase())) + .isEqualTo("first 3 capital words! then 10 TLAs, i found"); + } + + @Test + public void escapeRegexCharacters() { + Pattern regexCharacters = Pattern.compile("[<(\\[{\\\\^\\-=$!|\\]})?*+.>]"); + + assertThat(replaceTokens("A regex character like [", + regexCharacters, + match -> "\\" + match.group())) + .isEqualTo("A regex character like \\["); + } + + @Test + public void replacePlaceholders() { + Pattern placeholderPattern = Pattern.compile("\\$\\{(?[A-Za-z0-9-_]+)}"); + + Map placeholderValues = new HashMap<>(); + placeholderValues.put("name", "Bill"); + placeholderValues.put("company", "Baeldung"); + + assertThat(replaceTokens("Hi ${name} at ${company}", + placeholderPattern, + match -> placeholderValues.get(match.group("placeholder")))) + .isEqualTo("Hi Bill at Baeldung"); + } +} From c914d47a2329a6b669e0f733b54d0361a48be8c4 Mon Sep 17 00:00:00 2001 From: eric-martin Date: Sat, 7 Mar 2020 21:20:17 -0600 Subject: [PATCH 53/62] BAEL-3454: Moved AVLTree to data-structures module --- .../src/main/java/com/baeldung/avltree}/AVLTree.java | 2 +- .../src/test/java/com/baeldung/avltree}/AVLTreeUnitTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename {algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree => data-structures/src/main/java/com/baeldung/avltree}/AVLTree.java (98%) rename {algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree => data-structures/src/test/java/com/baeldung/avltree}/AVLTreeUnitTest.java (97%) diff --git a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/AVLTree.java b/data-structures/src/main/java/com/baeldung/avltree/AVLTree.java similarity index 98% rename from algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/AVLTree.java rename to data-structures/src/main/java/com/baeldung/avltree/AVLTree.java index a0575c8be1..ca0cfce7b4 100644 --- a/algorithms-miscellaneous-5/src/main/java/com/baeldung/algorithms/balancedbinarytree/AVLTree.java +++ b/data-structures/src/main/java/com/baeldung/avltree/AVLTree.java @@ -1,4 +1,4 @@ -package com.baeldung.algorithms.balancedbinarytree; +package com.baeldung.avltree; public class AVLTree { diff --git a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/AVLTreeUnitTest.java b/data-structures/src/test/java/com/baeldung/avltree/AVLTreeUnitTest.java similarity index 97% rename from algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/AVLTreeUnitTest.java rename to data-structures/src/test/java/com/baeldung/avltree/AVLTreeUnitTest.java index ab001b6696..56fc893232 100644 --- a/algorithms-miscellaneous-5/src/test/java/com/baeldung/algorithms/balancedbinarytree/AVLTreeUnitTest.java +++ b/data-structures/src/test/java/com/baeldung/avltree/AVLTreeUnitTest.java @@ -1,4 +1,4 @@ -package com.baeldung.algorithms.balancedbinarytree; +package com.baeldung.avltree; import org.junit.Assert; import org.junit.Test; From aed1fe44c5e7fe152882ee392ae30040b84764f2 Mon Sep 17 00:00:00 2001 From: dupirefr Date: Sun, 8 Mar 2020 09:48:35 +0100 Subject: [PATCH 54/62] [JAVA-138] Updated Maven Install Plugin version from 2.5.1 to 2.5.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 06efdb86e7..204d884005 100644 --- a/pom.xml +++ b/pom.xml @@ -1364,7 +1364,7 @@ 1.2.0 5.2.0 0.3.1 - 2.5.1 + 2.5.2 0.0.1 3.8 2.3 From 75200b6b20c92fe728798185bb4a5eba8c27212d Mon Sep 17 00:00:00 2001 From: "amit.pandey" Date: Sun, 8 Mar 2020 14:23:30 +0530 Subject: [PATCH 55/62] clean up plugins from pom file --- core-java-modules/core-java-8/pom.xml | 21 --- core-java-modules/core-java-arrays/pom.xml | 204 +-------------------- core-java-modules/core-java-sun/pom.xml | 15 -- core-java-modules/core-java/pom.xml | 204 --------------------- 4 files changed, 1 insertion(+), 443 deletions(-) diff --git a/core-java-modules/core-java-8/pom.xml b/core-java-modules/core-java-8/pom.xml index 889c30b76e..2a563333ad 100644 --- a/core-java-modules/core-java-8/pom.xml +++ b/core-java-modules/core-java-8/pom.xml @@ -48,25 +48,6 @@ true - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - repackage - - - spring-boot - com.baeldung.executable.ExecutableMavenJar - - - - - @@ -74,8 +55,6 @@ 4.1 3.6.1 - - 2.0.4.RELEASE diff --git a/core-java-modules/core-java-arrays/pom.xml b/core-java-modules/core-java-arrays/pom.xml index a70ab2d791..145b711135 100644 --- a/core-java-modules/core-java-arrays/pom.xml +++ b/core-java-modules/core-java-arrays/pom.xml @@ -66,101 +66,7 @@ - - org.apache.maven.plugins - maven-jar-plugin - ${maven-jar-plugin.version} - - - - true - libs/ - com.baeldung.executable.ExecutableMavenJar - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - package - - single - - - ${project.basedir} - - - com.baeldung.executable.ExecutableMavenJar - - - - jar-with-dependencies - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - ${maven-shade-plugin.version} - - - - shade - - - true - - - com.baeldung.executable.ExecutableMavenJar - - - - - - - - - com.jolira - onejar-maven-plugin - ${onejar-maven-plugin.version} - - - - com.baeldung.executable.ExecutableMavenJar - true - ${project.build.finalName}-onejar.${project.packaging} - - - one-jar - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - repackage - - - spring-boot - com.baeldung.executable.ExecutableMavenJar - - - - - + org.codehaus.mojo exec-maven-plugin @@ -250,110 +156,6 @@ - - - buildAgentLoader - - - - org.apache.maven.plugins - maven-jar-plugin - - - package - - jar - - - agentLoader - target/classes - - - true - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - com/baeldung/instrumentation/application/AgentLoader.class - com/baeldung/instrumentation/application/Launcher.class - - - - - - - - - - buildApplication - - - - org.apache.maven.plugins - maven-jar-plugin - - - package - - jar - - - application - target/classes - - - true - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - com/baeldung/instrumentation/application/MyAtm.class - com/baeldung/instrumentation/application/MyAtmApplication.class - com/baeldung/instrumentation/application/Launcher.class - - - - - - - - - - buildAgent - - - - org.apache.maven.plugins - maven-jar-plugin - - - package - - jar - - - agent - target/classes - - - true - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - com/baeldung/instrumentation/agent/AtmTransformer.class - com/baeldung/instrumentation/agent/MyInstrumentationAgent.class - - - - - - - - @@ -368,10 +170,6 @@ 3.0.0-M1 - 3.0.2 - 1.4.4 - 3.1.1 - 2.0.3.RELEASE 1.6.0 1.8 1.8 diff --git a/core-java-modules/core-java-sun/pom.xml b/core-java-modules/core-java-sun/pom.xml index c17bb6b8fc..4721eed278 100644 --- a/core-java-modules/core-java-sun/pom.xml +++ b/core-java-modules/core-java-sun/pom.xml @@ -40,20 +40,6 @@ - - org.apache.maven.plugins - maven-jar-plugin - ${maven-jar-plugin.version} - - - - true - libs/ - com.baeldung.executable.ExecutableMavenJar - - - - org.codehaus.mojo exec-maven-plugin @@ -115,7 +101,6 @@ 1.8.0 - 3.0.2 \ No newline at end of file diff --git a/core-java-modules/core-java/pom.xml b/core-java-modules/core-java/pom.xml index 5f60b43f79..06d0d85b50 100644 --- a/core-java-modules/core-java/pom.xml +++ b/core-java-modules/core-java/pom.xml @@ -90,101 +90,6 @@ - - org.apache.maven.plugins - maven-jar-plugin - ${maven-jar-plugin.version} - - - - true - libs/ - com.baeldung.executable.ExecutableMavenJar - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - package - - single - - - ${project.basedir} - - - com.baeldung.executable.ExecutableMavenJar - - - - jar-with-dependencies - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - ${maven-shade-plugin.version} - - - - shade - - - true - - - com.baeldung.executable.ExecutableMavenJar - - - - - - - - - com.jolira - onejar-maven-plugin - ${onejar-maven-plugin.version} - - - - com.baeldung.executable.ExecutableMavenJar - true - ${project.build.finalName}-onejar.${project.packaging} - - - one-jar - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot-maven-plugin.version} - - - - repackage - - - spring-boot - com.baeldung.executable.ExecutableMavenJar - - - - - org.codehaus.mojo exec-maven-plugin @@ -273,111 +178,6 @@ - - - - buildAgentLoader - - - - org.apache.maven.plugins - maven-jar-plugin - - - package - - jar - - - agentLoader - target/classes - - - true - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - com/baeldung/instrumentation/application/AgentLoader.class - com/baeldung/instrumentation/application/Launcher.class - - - - - - - - - - buildApplication - - - - org.apache.maven.plugins - maven-jar-plugin - - - package - - jar - - - application - target/classes - - - true - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - com/baeldung/instrumentation/application/MyAtm.class - com/baeldung/instrumentation/application/MyAtmApplication.class - com/baeldung/instrumentation/application/Launcher.class - - - - - - - - - - buildAgent - - - - org.apache.maven.plugins - maven-jar-plugin - - - package - - jar - - - agent - target/classes - - - true - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - - - com/baeldung/instrumentation/agent/AtmTransformer.class - com/baeldung/instrumentation/agent/MyInstrumentationAgent.class - - - - - - - - @@ -392,10 +192,6 @@ 1.1 3.0.0-M1 - 3.0.2 - 1.4.4 - 3.1.1 - 2.0.3.RELEASE 1.6.0 1.8 1.8 From a2488e4943f5eb219c7b42ee26ff11f4d7b51b10 Mon Sep 17 00:00:00 2001 From: Mona Mohamadinia Date: Mon, 9 Mar 2020 19:48:44 +0330 Subject: [PATCH 56/62] Bael 3653: Adding Pageable Support (#8766) * Removed the commented code * Upgrading the Spring Doc Version * Adding the Pageable Example In order to use `Pageable`, I had to add `spring-data-jpa` dep and H2. Also, the Spring doc version was quite outdated, so an upgrade for that, too. * Adding the Pageable Example In order to use `Pageable`, I had to add `spring-data-jpa` dep and H2. Also, the Spring doc version was quite outdated, so an upgrade for that, too. --- .../spring-boot-springdoc/pom.xml | 29 +++++++++---------- .../springdoc/controller/BookController.java | 7 +++++ .../springdoc/repository/BookRepository.java | 20 +++++++++---- .../src/main/resources/application.properties | 3 ++ 4 files changed, 37 insertions(+), 22 deletions(-) diff --git a/spring-boot-modules/spring-boot-springdoc/pom.xml b/spring-boot-modules/spring-boot-springdoc/pom.xml index 9212e56c5a..fd8a9e71ae 100644 --- a/spring-boot-modules/spring-boot-springdoc/pom.xml +++ b/spring-boot-modules/spring-boot-springdoc/pom.xml @@ -17,8 +17,8 @@ - 1.8 + 1.2.32 @@ -26,6 +26,14 @@ org.springframework.boot spring-boot-starter-web + + org.springframework.boot + spring-boot-starter-data-jpa + + + com.h2database + h2 + org.springframework.boot @@ -36,24 +44,13 @@ org.springdoc - springdoc-openapi-core - 1.1.49 - - - io.github.classgraph - classgraph - - + springdoc-openapi-ui + ${springdoc.version} org.springdoc - springdoc-openapi-ui - 1.1.49 - - - io.github.classgraph - classgraph - 4.8.44 + springdoc-openapi-data-rest + ${springdoc.version} diff --git a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/controller/BookController.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/controller/BookController.java index 4d7d9e3d85..05f8c5a946 100644 --- a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/controller/BookController.java +++ b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/controller/BookController.java @@ -6,6 +6,8 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; @@ -41,6 +43,11 @@ public class BookController { return repository.getBooks(); } + @GetMapping("/filter") + public Page filterBooks(Pageable pageable) { + return repository.getBooks(pageable); + } + @PutMapping("/{id}") @ResponseStatus(HttpStatus.OK) public Book updateBook(@PathVariable("id") final String id, @RequestBody final Book book) { diff --git a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/repository/BookRepository.java b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/repository/BookRepository.java index 4040ba28c2..0e3636d084 100644 --- a/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/repository/BookRepository.java +++ b/spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/springdoc/repository/BookRepository.java @@ -1,13 +1,14 @@ package com.baeldung.springdoc.repository; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - +import com.baeldung.springdoc.model.Book; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Repository; -import com.baeldung.springdoc.model.Book; +import java.util.*; + +import static java.util.stream.Collectors.toList; @Repository public class BookRepository { @@ -25,4 +26,11 @@ public class BookRepository { public Collection getBooks() { return books.values(); } + + public Page getBooks(Pageable pageable) { + int toSkip = pageable.getPageSize() * pageable.getPageNumber(); + List result = books.values().stream().skip(toSkip).limit(pageable.getPageSize()).collect(toList()); + + return new PageImpl<>(result, pageable, books.size()); + } } diff --git a/spring-boot-modules/spring-boot-springdoc/src/main/resources/application.properties b/spring-boot-modules/spring-boot-springdoc/src/main/resources/application.properties index f03e90feb6..45378e610b 100644 --- a/spring-boot-modules/spring-boot-springdoc/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot-springdoc/src/main/resources/application.properties @@ -3,3 +3,6 @@ springdoc.swagger-ui.path=/swagger-ui-custom.html # custom path for api docs springdoc.api-docs.path=/api-docs + +# H2 Related Configurations +spring.datasource.url=jdbc:h2:mem:springdoc \ No newline at end of file From 2aff1b5c77960056b1a576c1e3b4a51d7a6c4b3c Mon Sep 17 00:00:00 2001 From: David Calap Date: Mon, 9 Mar 2020 19:37:01 +0100 Subject: [PATCH 57/62] BAEL-3461 NullAwayExample --- libraries/pom.xml | 59 ++++++++++++++++++- .../baeldung/nullaway/NullAwayExample.java | 24 ++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 libraries/src/main/java/com/baeldung/nullaway/NullAwayExample.java diff --git a/libraries/pom.xml b/libraries/pom.xml index b5340d1ebb..af300657b0 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -435,7 +435,23 @@ reflections ${reflections.version} - + + com.uber.nullaway + nullaway + 0.3.0 + + + org.codehaus.plexus + plexus-compiler-javac-errorprone + 2.8 + + + + com.google.errorprone + error_prone_core + 2.1.3 + @@ -552,6 +568,47 @@ + + + org.apache.maven.plugins + maven-compiler-plugin + 3.5 + + javac-with-errorprone + true + 1.8 + 1.8 + true + + + com.uber.nullaway + nullaway + 0.3.0 + + + + + + -XepExcludedPaths:(.*)/test/.*|(.*)/streamex/.* + -XepOpt:NullAway:AnnotatedPackages=com.baeldung.nullaway + + + + + org.codehaus.plexus + plexus-compiler-javac-errorprone + 2.8 + + + + com.google.errorprone + error_prone_core + 2.1.3 + + + + diff --git a/libraries/src/main/java/com/baeldung/nullaway/NullAwayExample.java b/libraries/src/main/java/com/baeldung/nullaway/NullAwayExample.java new file mode 100644 index 0000000000..f3db1d2df9 --- /dev/null +++ b/libraries/src/main/java/com/baeldung/nullaway/NullAwayExample.java @@ -0,0 +1,24 @@ +package com.baeldung.nullaway; + +import com.baeldung.distinct.Person; + +public class NullAwayExample { + + /* + * 1- NullAway will warn about yearsToRetirement method + * 2- Uncomment @Nullable in printAge and NullAway will warn about this method + * 3- Add a standard null check to be NullAway compliant + * 4- Build will be SUCCESS + */ + + static Integer getAge(/*@Nullable*/ Person person) { + return person.getAge(); + } + + Integer yearsToRetirement() { + Person p = null; + // ... p never gets set correctly... + return 65 - getAge(p); + } + +} \ No newline at end of file From 34c8c9cc548801ce5a13e7365c9087205435dde7 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Tue, 10 Mar 2020 16:27:10 +0330 Subject: [PATCH 58/62] Using An In-Memory H2 Instance --- azure/src/main/resources/application.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure/src/main/resources/application.properties b/azure/src/main/resources/application.properties index 32ee873194..1c92245a6f 100644 --- a/azure/src/main/resources/application.properties +++ b/azure/src/main/resources/application.properties @@ -5,7 +5,7 @@ spring.jpa.hibernate.ddl-auto=create logging.file=azure.log logging.level.root=info -spring.datasource.url=jdbc:h2:file:~/test +spring.datasource.url=jdbc:h2:mem:azure-test-db spring.datasource.username=sa spring.datasource.password= From 07bec4d5b26aedd32e2ca0755a60ca1dda3e10f2 Mon Sep 17 00:00:00 2001 From: kwoyke Date: Wed, 11 Mar 2020 06:43:46 +0100 Subject: [PATCH 59/62] BAEL-3775: Clean up unit tests for Stack (#8837) --- .../com/baeldung/stack/StackUnitTest.java | 100 +++++++++++++----- 1 file changed, 73 insertions(+), 27 deletions(-) diff --git a/core-java-modules/core-java/src/test/java/com/baeldung/stack/StackUnitTest.java b/core-java-modules/core-java/src/test/java/com/baeldung/stack/StackUnitTest.java index 2b04617f36..6a2feff551 100644 --- a/core-java-modules/core-java/src/test/java/com/baeldung/stack/StackUnitTest.java +++ b/core-java-modules/core-java/src/test/java/com/baeldung/stack/StackUnitTest.java @@ -1,123 +1,153 @@ package com.baeldung.stack; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.junit.Assert.*; +import org.junit.Test; import java.util.Arrays; import java.util.List; import java.util.ListIterator; import java.util.Stack; +import java.util.stream.Collectors; -import org.junit.Test; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertTrue; public class StackUnitTest { @Test - public void whenStackIsCreated_thenItHasSize0() { - Stack intStack = new Stack(); + public void whenStackIsCreated_thenItHasSizeZero() { + Stack intStack = new Stack<>(); + assertEquals(0, intStack.size()); } @Test - public void givenEmptyStack_whenElementIsPushed_thenStackSizeisIncreased() { - Stack intStack = new Stack(); + public void whenElementIsPushed_thenStackSizeIsIncreased() { + Stack intStack = new Stack<>(); intStack.push(1); + assertEquals(1, intStack.size()); } @Test - public void givenEmptyStack_whenMultipleElementsArePushed_thenStackSizeisIncreased() { - Stack intStack = new Stack(); + public void whenMultipleElementsArePushed_thenStackSizeIsIncreased() { + Stack intStack = new Stack<>(); List intList = Arrays.asList(1, 2, 3, 4, 5, 6, 7); + boolean result = intStack.addAll(intList); + assertTrue(result); assertEquals(7, intList.size()); } @Test public void whenElementIsPoppedFromStack_thenElementIsRemovedAndSizeChanges() { - Stack intStack = new Stack(); + Stack intStack = new Stack<>(); intStack.push(5); - intStack.pop(); + + Integer element = intStack.pop(); + + assertEquals(Integer.valueOf(5), element); assertTrue(intStack.isEmpty()); } @Test public void whenElementIsPeeked_thenElementIsNotRemovedAndSizeDoesNotChange() { - Stack intStack = new Stack(); + Stack intStack = new Stack<>(); intStack.push(5); - intStack.peek(); + + Integer element = intStack.peek(); + + assertEquals(Integer.valueOf(5), element); assertEquals(1, intStack.search(5)); assertEquals(1, intStack.size()); } @Test public void whenElementIsOnStack_thenSearchReturnsItsDistanceFromTheTop() { - Stack intStack = new Stack(); + Stack intStack = new Stack<>(); intStack.push(5); - assertEquals(1, intStack.search(5)); + intStack.push(8); + + assertEquals(2, intStack.search(5)); } @Test public void whenElementIsOnStack_thenIndexOfReturnsItsIndex() { - Stack intStack = new Stack(); + Stack intStack = new Stack<>(); intStack.push(5); + int indexOf = intStack.indexOf(5); + assertEquals(0, indexOf); } @Test public void whenMultipleElementsAreOnStack_thenIndexOfReturnsLastElementIndex() { - Stack intStack = new Stack(); + Stack intStack = new Stack<>(); intStack.push(5); intStack.push(5); intStack.push(5); + int lastIndexOf = intStack.lastIndexOf(5); + assertEquals(2, lastIndexOf); } @Test - public void givenElementOnStack_whenRemoveElementIsInvoked_thenElementIsRemoved() { - Stack intStack = new Stack(); + public void whenRemoveElementIsInvoked_thenElementIsRemoved() { + Stack intStack = new Stack<>(); intStack.push(5); intStack.push(5); + intStack.removeElement(5); + assertEquals(1, intStack.size()); } @Test - public void givenElementOnStack_whenRemoveElementAtIsInvoked_thenElementIsRemoved() { - Stack intStack = new Stack(); + public void whenRemoveElementAtIsInvoked_thenElementIsRemoved() { + Stack intStack = new Stack<>(); intStack.push(5); intStack.push(7); + intStack.removeElementAt(1); + assertEquals(-1, intStack.search(7)); } @Test - public void givenElementsOnStack_whenRemoveAllElementsIsInvoked_thenAllElementsAreRemoved() { - Stack intStack = new Stack(); + public void whenRemoveAllElementsIsInvoked_thenAllElementsAreRemoved() { + Stack intStack = new Stack<>(); intStack.push(5); intStack.push(7); + intStack.removeAllElements(); + assertTrue(intStack.isEmpty()); } @Test public void givenElementsOnStack_whenRemoveAllIsInvoked_thenAllElementsFromCollectionAreRemoved() { - Stack intStack = new Stack(); + Stack intStack = new Stack<>(); List intList = Arrays.asList(1, 2, 3, 4, 5, 6, 7); intStack.addAll(intList); intStack.add(500); + intStack.removeAll(intList); + assertEquals(1, intStack.size()); + assertEquals(1, intStack.search(500)); } @Test - public void givenElementsOnStack_whenRemoveIfIsInvoked_thenAllElementsSatysfyingConditionAreRemoved() { - Stack intStack = new Stack(); + public void whenRemoveIfIsInvoked_thenAllElementsSatysfyingConditionAreRemoved() { + Stack intStack = new Stack<>(); List intList = Arrays.asList(1, 2, 3, 4, 5, 6, 7); intStack.addAll(intList); + intStack.removeIf(element -> element < 6); + assertEquals(2, intStack.size()); } @@ -126,12 +156,28 @@ public class StackUnitTest { Stack intStack = new Stack<>(); List intList = Arrays.asList(1, 2, 3, 4, 5, 6, 7); intStack.addAll(intList); + ListIterator it = intStack.listIterator(); - Stack result = new Stack(); + + Stack result = new Stack<>(); while(it.hasNext()) { result.push(it.next()); } assertThat(result, equalTo(intStack)); } + + @Test + public void whenStackIsFiltered_allElementsNotSatisfyingFilterConditionAreDiscarded() { + Stack intStack = new Stack<>(); + List inputIntList = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 9, 10); + intStack.addAll(inputIntList); + + List filtered = intStack + .stream() + .filter(element -> element <= 3) + .collect(Collectors.toList()); + + assertEquals(3, filtered.size()); + } } From 84c78797f5c2e7dcca3f2441c64c94f13b599f30 Mon Sep 17 00:00:00 2001 From: Vivek Date: Wed, 11 Mar 2020 23:25:14 +0530 Subject: [PATCH 60/62] Delete everything in Redis (#8823) --- .../spring/data/redis/config/RedisConfig.java | 20 +++- .../RedisFlushDatabaseIntegrationTest.java | 92 +++++++++++++++++++ 2 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/delete/RedisFlushDatabaseIntegrationTest.java diff --git a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java index 6fdb3c5bef..fdc279be42 100644 --- a/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java +++ b/persistence-modules/spring-data-redis/src/main/java/com/baeldung/spring/data/redis/config/RedisConfig.java @@ -1,13 +1,11 @@ package com.baeldung.spring.data.redis.config; -import com.baeldung.spring.data.redis.queue.MessagePublisher; -import com.baeldung.spring.data.redis.queue.RedisMessagePublisher; -import com.baeldung.spring.data.redis.queue.RedisMessageSubscriber; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.data.redis.connection.jedis.JedisConnectionFactory; +import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.listener.ChannelTopic; import org.springframework.data.redis.listener.RedisMessageListenerContainer; @@ -15,6 +13,10 @@ import org.springframework.data.redis.listener.adapter.MessageListenerAdapter; import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; import org.springframework.data.redis.serializer.GenericToStringSerializer; +import com.baeldung.spring.data.redis.queue.MessagePublisher; +import com.baeldung.spring.data.redis.queue.RedisMessagePublisher; +import com.baeldung.spring.data.redis.queue.RedisMessageSubscriber; + @Configuration @ComponentScan("com.baeldung.spring.data.redis") @EnableRedisRepositories(basePackages = "com.baeldung.spring.data.redis.repo") @@ -33,6 +35,18 @@ public class RedisConfig { template.setValueSerializer(new GenericToStringSerializer(Object.class)); return template; } + + @Bean + public LettuceConnectionFactory lettuceConnectionFactory() { + return new LettuceConnectionFactory(); + } + + @Bean(name = "flushRedisTemplate") + public RedisTemplate flushRedisTemplate() { + RedisTemplate template = new RedisTemplate<>(); + template.setConnectionFactory(lettuceConnectionFactory()); + return template; + } @Bean MessageListenerAdapter messageListener() { diff --git a/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/delete/RedisFlushDatabaseIntegrationTest.java b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/delete/RedisFlushDatabaseIntegrationTest.java new file mode 100644 index 0000000000..1f56cbb25d --- /dev/null +++ b/persistence-modules/spring-data-redis/src/test/java/com/baeldung/spring/data/redis/delete/RedisFlushDatabaseIntegrationTest.java @@ -0,0 +1,92 @@ +package com.baeldung.spring.data.redis.delete; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.io.IOException; + +import org.junit.After; +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.dao.DataAccessException; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.DirtiesContext.ClassMode; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import com.baeldung.spring.data.redis.config.RedisConfig; + +import redis.embedded.RedisServer; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = { RedisConfig.class }) +@DirtiesContext(classMode = ClassMode.BEFORE_CLASS) +public class RedisFlushDatabaseIntegrationTest { + + private RedisServer redisServer; + + @Autowired + @Qualifier("flushRedisTemplate") + private RedisTemplate flushRedisTemplate; + + @Before + public void setup() throws IOException { + redisServer = new RedisServer(6390); + redisServer.start(); + } + + @After + public void tearDown() { + redisServer.stop(); + } + + @Test + public void whenFlushDB_thenAllKeysInDatabaseAreCleared() { + + ValueOperations simpleValues = flushRedisTemplate.opsForValue(); + String key = "key"; + String value = "value"; + simpleValues.set(key, value); + assertThat(simpleValues.get(key)).isEqualTo(value); + + flushRedisTemplate.execute(new RedisCallback() { + + @Override + public Void doInRedis(RedisConnection connection) throws DataAccessException { + connection.flushDb(); + return null; + } + }); + + assertThat(simpleValues.get(key)).isNull(); + + } + + @Test + public void whenFlushAll_thenAllKeysInDatabasesAreCleared() { + + ValueOperations simpleValues = flushRedisTemplate.opsForValue(); + String key = "key"; + String value = "value"; + simpleValues.set(key, value); + assertThat(simpleValues.get(key)).isEqualTo(value); + + flushRedisTemplate.execute(new RedisCallback() { + + @Override + public Void doInRedis(RedisConnection connection) throws DataAccessException { + connection.flushAll(); + return null; + } + }); + + assertThat(simpleValues.get(key)).isNull(); + + } +} \ No newline at end of file From 356ef842f0f024b90fb1261bb99604cfbbace944 Mon Sep 17 00:00:00 2001 From: omerfinger <43134354+omerfinger@users.noreply.github.com> Date: Wed, 11 Mar 2020 19:59:01 +0200 Subject: [PATCH 61/62] How to compare json objects using gson article (#8793) * How to compare json objects using gson article * static Assert import IsObject assert has been deleted * compare strings test failure example --- .../gson/jsoncompare/JsonCompareUnitTest.java | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 gson/src/test/java/com/baeldung/gson/jsoncompare/JsonCompareUnitTest.java diff --git a/gson/src/test/java/com/baeldung/gson/jsoncompare/JsonCompareUnitTest.java b/gson/src/test/java/com/baeldung/gson/jsoncompare/JsonCompareUnitTest.java new file mode 100644 index 0000000000..84989a7411 --- /dev/null +++ b/gson/src/test/java/com/baeldung/gson/jsoncompare/JsonCompareUnitTest.java @@ -0,0 +1,95 @@ +package com.baeldung.gson.jsoncompare; + +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import org.junit.Test; +import static org.junit.Assert.*; + +public class JsonCompareUnitTest { + @Test + public void givenJsonStrings_whenCompared_thenNotEqual() { + String string1 = "{\"fullName\": \"Emily Jenkins\", \"age\": 27 }"; + String string2 = "{\"fullName\": \"Emily Jenkins\", \"age\": 27}"; + + assertNotEquals(string1, string2); + } + + @Test + public void givenIdenticalSimpleObjects_whenCompared_thenEqual() { + JsonParser parser = new JsonParser(); + String string1 = "{\"customer\": {\"id\": \"44521\",\"fullName\": \"Emily Jenkins\", \"age\": 27 }}"; + String string2 = "{\"customer\": {\"id\": \"44521\", \"fullName\": \"Emily Jenkins\",\"age\": 27}}"; + + assertTrue(parser.parse(string1) + .isJsonObject()); + assertEquals(parser.parse(string1), parser.parse(string2)); + } + + @Test + public void givenSameObjectsInDifferentOrder_whenCompared_thenEqual() { + JsonParser parser = new JsonParser(); + String string1 = "{\"customer\": {\"id\": \"44521\",\"fullName\": \"Emily Jenkins\", \"age\": 27 }}"; + String string2 = "{\"customer\": {\"id\": \"44521\",\"age\": 27, \"fullName\": \"Emily Jenkins\" }}"; + + JsonElement json1 = parser.parse(string1); + JsonElement json2 = parser.parse(string2); + + assertEquals(json1, json2); + } + + @Test + public void givenIdenticalArrays_whenCompared_thenEqual() { + JsonParser parser = new JsonParser(); + String string1 = "[10, 20, 30]"; + String string2 = "[10, 20, 30]"; + + assertTrue(parser.parse(string1) + .isJsonArray()); + assertEquals(parser.parse(string1), parser.parse(string2)); + } + + @Test + public void givenArraysInDifferentOrder_whenCompared_thenNotEqual() { + JsonParser parser = new JsonParser(); + String string1 = "[20, 10, 30]"; + String string2 = "[10, 20, 30]"; + + assertNotEquals(parser.parse(string1), parser.parse(string2)); + } + + @Test + public void givenIdenticalNestedObjects_whenCompared_thenEqual() { + JsonParser parser = new JsonParser(); + String string1 = "{\"customer\": {\"id\": \"44521\",\"fullName\": \"Emily Jenkins\", \"age\": 27, \"consumption_info\" : {\"fav_product\": \"Coke\", \"last_buy\": \"2012-04-23\"}}}"; + String string2 = "{\"customer\": {\"id\": \"44521\",\"fullName\": \"Emily Jenkins\", \"age\": 27, \"consumption_info\" : {\"last_buy\": \"2012-04-23\", \"fav_product\": \"Coke\"}}}"; + + JsonElement json1 = parser.parse(string1); + JsonElement json2 = parser.parse(string2); + + assertEquals(json1, json2); + } + + @Test + public void givenIdenticalNestedObjectsWithArray_whenCompared_thenEqual() { + JsonParser parser = new JsonParser(); + String string1 = "{\"customer\": {\"id\": \"44521\",\"fullName\": \"Emily Jenkins\", \"age\": 27, \"consumption_info\" : {\"last_buy\": \"2012-04-23\", \"prouducts\": [\"banana\", \"eggs\"]}}}"; + String string2 = "{\"customer\": {\"id\": \"44521\",\"fullName\": \"Emily Jenkins\", \"age\": 27, \"consumption_info\" : {\"last_buy\": \"2012-04-23\", \"prouducts\": [\"banana\", \"eggs\"]}}}"; + + JsonElement json1 = parser.parse(string1); + JsonElement json2 = parser.parse(string2); + + assertEquals(json1, json2); + } + + @Test + public void givenNestedObjectsDifferentArrayOrder_whenCompared_thenNotEqual() { + JsonParser parser = new JsonParser(); + String string1 = "{\"customer\": {\"id\": \"44521\",\"fullName\": \"Emily Jenkins\", \"age\": 27, \"consumption_info\" : {\"last_buy\": \"2012-04-23\", \"prouducts\": [\"banana\", \"eggs\"]}}}"; + String string2 = "{\"customer\": {\"id\": \"44521\",\"fullName\": \"Emily Jenkins\", \"age\": 27, \"consumption_info\" : {\"last_buy\": \"2012-04-23\", \"prouducts\": [\"eggs\", \"banana\"]}}}"; + + JsonElement json1 = parser.parse(string1); + JsonElement json2 = parser.parse(string2); + + assertNotEquals(json1, json2); + } +} From 8be4255cbba970012eba8648349e6230a0e3ce42 Mon Sep 17 00:00:00 2001 From: Roman <32590063+oskar9247@users.noreply.github.com> Date: Wed, 11 Mar 2020 19:43:43 +0100 Subject: [PATCH 62/62] BAEL-3497 IntelliJ Cannot Resolve Spring Boot Configuration Properties (#8775) Co-authored-by: Oskar <> --- .../spring-boot-properties/pom.xml | 7 ++++ .../processor/CustomProperties.java | 37 +++++++++++++++++++ .../processor/DemoApplication.java | 12 ++++++ .../processor/PropertyBeanInjection.java | 22 +++++++++++ .../PropertyBeanInjectionUnitTest.java | 24 ++++++++++++ .../configuration-processor.properties | 2 + 6 files changed, 104 insertions(+) create mode 100644 spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/CustomProperties.java create mode 100644 spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/DemoApplication.java create mode 100644 spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/PropertyBeanInjection.java create mode 100644 spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configuration/processor/PropertyBeanInjectionUnitTest.java create mode 100644 spring-boot-modules/spring-boot-properties/src/test/resources/configuration-processor.properties diff --git a/spring-boot-modules/spring-boot-properties/pom.xml b/spring-boot-modules/spring-boot-properties/pom.xml index 04879a5052..ec05ec1bdc 100644 --- a/spring-boot-modules/spring-boot-properties/pom.xml +++ b/spring-boot-modules/spring-boot-properties/pom.xml @@ -43,6 +43,12 @@ httpcore ${httpcore.version} + + org.springframework.boot + spring-boot-configuration-processor + ${configuration-processor.version} + true + @@ -121,6 +127,7 @@ 20.0 4.4.11 @ + 2.2.4.RELEASE diff --git a/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/CustomProperties.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/CustomProperties.java new file mode 100644 index 0000000000..398b7557c4 --- /dev/null +++ b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/CustomProperties.java @@ -0,0 +1,37 @@ +package com.baeldung.configuration.processor; + +import org.springframework.boot.context.properties.*; +import org.springframework.context.annotation.*; + +@Configuration +@ConfigurationProperties(prefix = "com.baeldung") +public class CustomProperties { + + /** + * The url to connect to. + */ + String url; + + /** + * The time to wait for the connection. + */ + private int timeoutInMilliSeconds = 1000; + + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public int getTimeoutInMilliSeconds() { + return timeoutInMilliSeconds; + } + + public void setTimeoutInMilliSeconds(int timeoutInMilliSeconds) { + this.timeoutInMilliSeconds = timeoutInMilliSeconds; + } + +} diff --git a/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/DemoApplication.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/DemoApplication.java new file mode 100644 index 0000000000..1a35de86da --- /dev/null +++ b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/DemoApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.configuration.processor; + +import org.springframework.boot.*; +import org.springframework.boot.autoconfigure.*; + +@SpringBootApplication +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } +} diff --git a/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/PropertyBeanInjection.java b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/PropertyBeanInjection.java new file mode 100644 index 0000000000..3bcbf41f54 --- /dev/null +++ b/spring-boot-modules/spring-boot-properties/src/main/java/com/baeldung/configuration/processor/PropertyBeanInjection.java @@ -0,0 +1,22 @@ +package com.baeldung.configuration.processor; + +import org.springframework.beans.factory.annotation.*; +import org.springframework.stereotype.*; + +@Component +public class PropertyBeanInjection { + + private final CustomProperties customProperties; + + PropertyBeanInjection(@Autowired CustomProperties customProperties) { + this.customProperties = customProperties; + } + + String getUrl() { + return customProperties.getUrl(); + } + + int getTimeoutInMilliseconds() { + return customProperties.getTimeoutInMilliSeconds(); + } +} diff --git a/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configuration/processor/PropertyBeanInjectionUnitTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configuration/processor/PropertyBeanInjectionUnitTest.java new file mode 100644 index 0000000000..bdeb6547c3 --- /dev/null +++ b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/configuration/processor/PropertyBeanInjectionUnitTest.java @@ -0,0 +1,24 @@ +package com.baeldung.configuration.processor; + +import org.junit.jupiter.api.*; +import org.junit.runner.*; +import org.springframework.beans.factory.annotation.*; +import org.springframework.boot.test.context.*; +import org.springframework.test.context.*; +import org.springframework.test.context.junit4.*; + +@RunWith(SpringRunner.class) +@TestPropertySource("/configuration-processor.properties") +@SpringBootTest(classes = DemoApplication.class) +class PropertyBeanInjectionUnitTest { + + @Autowired + private PropertyBeanInjection propertyBeanInjection; + + @Test + void checkThatCustomPropertiesHaveTheCorrectValueFromPropertiesFile() { + Assertions.assertEquals("www.abc.test.com", propertyBeanInjection.getUrl()); + Assertions.assertEquals(2000, propertyBeanInjection.getTimeoutInMilliseconds()); + } + +} diff --git a/spring-boot-modules/spring-boot-properties/src/test/resources/configuration-processor.properties b/spring-boot-modules/spring-boot-properties/src/test/resources/configuration-processor.properties new file mode 100644 index 0000000000..00369f2eff --- /dev/null +++ b/spring-boot-modules/spring-boot-properties/src/test/resources/configuration-processor.properties @@ -0,0 +1,2 @@ +com.baeldung.url=www.abc.test.com +com.baeldung.timeout-in-milli-seconds=2000