4.0.0
dropwizard
0.0.1-SNAPSHOT
@@ -48,8 +49,7 @@
-
+
com.baeldung.dropwizard.introduction.IntroductionApplication
diff --git a/dubbo/pom.xml b/dubbo/pom.xml
index 9a7aceb9e5..cca1b3a3d1 100644
--- a/dubbo/pom.xml
+++ b/dubbo/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
dubbo
dubbo
diff --git a/ethereum/pom.xml b/ethereum/pom.xml
index 8c7e4c8c4c..5953195123 100644
--- a/ethereum/pom.xml
+++ b/ethereum/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
com.baeldung.ethereum
ethereum
diff --git a/feign/pom.xml b/feign/pom.xml
index 6dc8e7bafa..4b994be1f2 100644
--- a/feign/pom.xml
+++ b/feign/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
com.baeldung.feign
feign
diff --git a/flyway-cdi-extension/pom.xml b/flyway-cdi-extension/pom.xml
index 8f7d058db7..566eed95d8 100644
--- a/flyway-cdi-extension/pom.xml
+++ b/flyway-cdi-extension/pom.xml
@@ -1,7 +1,8 @@
-
+
4.0.0
flyway-cdi-extension
1.0-SNAPSHOT
diff --git a/geotools/pom.xml b/geotools/pom.xml
index 71489bdf94..46913daa69 100644
--- a/geotools/pom.xml
+++ b/geotools/pom.xml
@@ -1,7 +1,8 @@
-
+
4.0.0
geotools
0.0.1-SNAPSHOT
diff --git a/google-cloud/pom.xml b/google-cloud/pom.xml
index 15f7f5c824..1e474b5dd0 100644
--- a/google-cloud/pom.xml
+++ b/google-cloud/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
google-cloud
0.1-SNAPSHOT
diff --git a/google-web-toolkit/pom.xml b/google-web-toolkit/pom.xml
index 37e423b3af..6fdcae4f75 100644
--- a/google-web-toolkit/pom.xml
+++ b/google-web-toolkit/pom.xml
@@ -1,7 +1,8 @@
-
+
4.0.0
google-web-toolkit
@@ -53,8 +54,7 @@
-
+
${project.build.directory}/${project.build.finalName}/WEB-INF/classes
@@ -76,8 +76,7 @@
com.baeldung.Google_web_toolkit
Google_web_toolkit
true
-
+
${maven.compiler.source}
@@ -109,9 +108,8 @@
-
+
1.8
1.8
diff --git a/gradle/gradle-employee-app/.gitignore b/gradle/gradle-employee-app/.gitignore
new file mode 100644
index 0000000000..d347f664af
--- /dev/null
+++ b/gradle/gradle-employee-app/.gitignore
@@ -0,0 +1,3 @@
+/.idea
+/.gradle
+/build
diff --git a/gradle/gradle-employee-app/build.gradle b/gradle/gradle-employee-app/build.gradle
new file mode 100644
index 0000000000..19b80c0c4a
--- /dev/null
+++ b/gradle/gradle-employee-app/build.gradle
@@ -0,0 +1,38 @@
+
+plugins {
+ id 'java-library'
+ id 'application'
+}
+
+apply plugin: 'application'
+mainClassName = 'employee.EmployeeApp'
+
+java {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+}
+
+println 'This is executed during configuration phase'
+
+task configured {
+ println 'The project is configured'
+}
+
+task wrapper(type: Wrapper){
+ gradleVersion = '5.3.1'
+}
+
+repositories {
+ jcenter()
+}
+
+dependencies {
+
+ compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
+ testImplementation('junit:junit:4.13')
+ testRuntime('junit:junit:4.13')
+}
+test {
+ useJUnit()
+}
+
diff --git a/gradle/gradle-employee-app/src/main/java/employee/Employee.java b/gradle/gradle-employee-app/src/main/java/employee/Employee.java
new file mode 100644
index 0000000000..6940c8c28c
--- /dev/null
+++ b/gradle/gradle-employee-app/src/main/java/employee/Employee.java
@@ -0,0 +1,9 @@
+package employee;
+
+public class Employee {
+
+ String name;
+ String emailAddress;
+ int yearOfBirth;
+
+}
\ No newline at end of file
diff --git a/gradle/gradle-employee-app/src/main/java/employee/EmployeeApp.java b/gradle/gradle-employee-app/src/main/java/employee/EmployeeApp.java
new file mode 100644
index 0000000000..48ef9f5d61
--- /dev/null
+++ b/gradle/gradle-employee-app/src/main/java/employee/EmployeeApp.java
@@ -0,0 +1,16 @@
+package employee;
+
+public class EmployeeApp {
+
+ public static void main(String[] args){
+
+ Employee employee = new Employee();
+ employee.name = "John";
+ employee.emailAddress = "john@baeldung.com";
+ employee.yearOfBirth = 1978;
+ System.out.println("Name: " + employee.name);
+ System.out.println("Email Address: " + employee.emailAddress);
+ System.out.println("Year Of Birth:" + employee.yearOfBirth);
+ }
+
+}
diff --git a/gradle/gradle-employee-app/src/test/java/employee/EmployeeAppTest.java b/gradle/gradle-employee-app/src/test/java/employee/EmployeeAppTest.java
new file mode 100644
index 0000000000..013bcc35b6
--- /dev/null
+++ b/gradle/gradle-employee-app/src/test/java/employee/EmployeeAppTest.java
@@ -0,0 +1,31 @@
+package employee;
+
+import employee.Employee;
+import org.junit.*;
+import static org.junit.Assert.*;
+
+public class EmployeeAppTest {
+
+ @Test
+ public void testData(){
+
+ Employee testEmp = this.getEmployeeTest();
+
+ assertEquals(testEmp.name, "John");
+ assertEquals(testEmp.emailAddress, "john@baeldung.com");
+ assertEquals(testEmp.yearOfBirth, 1978);
+
+
+ }
+
+ private Employee getEmployeeTest(){
+
+ Employee employee = new Employee();
+ employee.name = "John";
+ employee.emailAddress = "john@baeldung.com";
+ employee.yearOfBirth = 1978;
+
+ return employee;
+ }
+
+}
\ No newline at end of file
diff --git a/gradle/settings.gradle b/gradle/settings.gradle
index f1d64de58a..59300f9281 100644
--- a/gradle/settings.gradle
+++ b/gradle/settings.gradle
@@ -1,10 +1,10 @@
rootProject.name = 'gradletutorial'
-
include 'greeting-library'
include 'greeting-library-java'
include 'greeter'
include 'gradletaskdemo'
include 'junit5'
+include 'gradle-employee-app'
println 'This will be executed during the initialization phase.'
diff --git a/graphql/graphql-java/pom.xml b/graphql/graphql-java/pom.xml
index 793a02458a..30bfbf555a 100644
--- a/graphql/graphql-java/pom.xml
+++ b/graphql/graphql-java/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
com.baeldung.graphql
graphql-java
diff --git a/grpc/pom.xml b/grpc/pom.xml
index c7ae111da3..5e1c0bb28b 100644
--- a/grpc/pom.xml
+++ b/grpc/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
grpc
0.0.1-SNAPSHOT
diff --git a/gson/pom.xml b/gson/pom.xml
index f2ed5509fa..0de9a6a533 100644
--- a/gson/pom.xml
+++ b/gson/pom.xml
@@ -1,7 +1,8 @@
-
+
4.0.0
gson
0.1-SNAPSHOT
diff --git a/guava-collections-map/README.md b/guava-collections-map/README.md
index b3ec5e2157..4f8743dcfb 100644
--- a/guava-collections-map/README.md
+++ b/guava-collections-map/README.md
@@ -9,4 +9,5 @@ This module contains articles about map collections in Guava
- [Guide to Guava Multimap](https://www.baeldung.com/guava-multimap)
- [Guide to Guava RangeMap](https://www.baeldung.com/guava-rangemap)
- [Initialize a HashMap in Java](https://www.baeldung.com/java-initialize-hashmap)
-- [Guide to Guava ClassToInstanceMap](https://www.baeldung.com/guava-class-to-instance-map)
\ No newline at end of file
+- [Guide to Guava ClassToInstanceMap](https://www.baeldung.com/guava-class-to-instance-map)
+- [Using Guava’s MapMaker](https://www.baeldung.com/guava-mapmaker)
diff --git a/guava-collections-map/src/main/java/com/baeldung/guava/mapmaker/Profile.java b/guava-collections-map/src/main/java/com/baeldung/guava/mapmaker/Profile.java
new file mode 100644
index 0000000000..165c5a9f8f
--- /dev/null
+++ b/guava-collections-map/src/main/java/com/baeldung/guava/mapmaker/Profile.java
@@ -0,0 +1,20 @@
+package com.baeldung.guava.mapmaker;
+
+public class Profile {
+ private long id;
+ private String type;
+
+ public Profile(long id, String type) {
+ this.id = id;
+ this.type = type;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return type;
+ }
+
+}
diff --git a/guava-collections-map/src/main/java/com/baeldung/guava/mapmaker/Session.java b/guava-collections-map/src/main/java/com/baeldung/guava/mapmaker/Session.java
new file mode 100644
index 0000000000..a614f431f8
--- /dev/null
+++ b/guava-collections-map/src/main/java/com/baeldung/guava/mapmaker/Session.java
@@ -0,0 +1,13 @@
+package com.baeldung.guava.mapmaker;
+
+public class Session {
+ private long id;
+
+ public Session(long id) {
+ this.id = id;
+ }
+
+ public long getId() {
+ return id;
+ }
+}
diff --git a/guava-collections-map/src/main/java/com/baeldung/guava/mapmaker/User.java b/guava-collections-map/src/main/java/com/baeldung/guava/mapmaker/User.java
new file mode 100644
index 0000000000..a7f0435049
--- /dev/null
+++ b/guava-collections-map/src/main/java/com/baeldung/guava/mapmaker/User.java
@@ -0,0 +1,20 @@
+package com.baeldung.guava.mapmaker;
+
+public class User {
+ private long id;
+ private String name;
+
+ public User(long id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+}
diff --git a/guava-collections-map/src/test/java/com/baeldung/guava/mapmaker/GuavaMapMakerUnitTest.java b/guava-collections-map/src/test/java/com/baeldung/guava/mapmaker/GuavaMapMakerUnitTest.java
new file mode 100644
index 0000000000..754e3ac099
--- /dev/null
+++ b/guava-collections-map/src/test/java/com/baeldung/guava/mapmaker/GuavaMapMakerUnitTest.java
@@ -0,0 +1,53 @@
+package com.baeldung.guava.mapmaker;
+
+import com.google.common.collect.MapMaker;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.concurrent.ConcurrentMap;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.Assert.assertNotNull;
+
+public class GuavaMapMakerUnitTest {
+ @Test
+ public void whenCreateCaches_thenCreated() {
+ ConcurrentMap sessionCache = new MapMaker().makeMap();
+ assertNotNull(sessionCache);
+
+ ConcurrentMap profileCache = new MapMaker().makeMap();
+ assertNotNull(profileCache);
+
+ User userA = new User(1, "UserA");
+
+ sessionCache.put(userA, new Session(100));
+ Assert.assertThat(sessionCache.size(), equalTo(1));
+
+ profileCache.put(userA, new Profile(1000, "Personal"));
+ Assert.assertThat(profileCache.size(), equalTo(1));
+ }
+
+ @Test
+ public void whenCreateCacheWithInitialCapacity_thenCreated() {
+ ConcurrentMap profileCache = new MapMaker().initialCapacity(100).makeMap();
+ assertNotNull(profileCache);
+ }
+
+ @Test
+ public void whenCreateCacheWithConcurrencyLevel_thenCreated() {
+ ConcurrentMap sessionCache = new MapMaker().concurrencyLevel(10).makeMap();
+ assertNotNull(sessionCache);
+ }
+
+ @Test
+ public void whenCreateCacheWithWeakKeys_thenCreated() {
+ ConcurrentMap sessionCache = new MapMaker().weakKeys().makeMap();
+ assertNotNull(sessionCache);
+ }
+
+ @Test
+ public void whenCreateCacheWithWeakValues_thenCreated() {
+ ConcurrentMap profileCache = new MapMaker().weakValues().makeMap();
+ assertNotNull(profileCache);
+ }
+}
diff --git a/guava-collections/pom.xml b/guava-collections/pom.xml
index 9002ac2b91..c6019362c5 100644
--- a/guava-collections/pom.xml
+++ b/guava-collections/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
guava-collections
0.1.0-SNAPSHOT
diff --git a/guava/README.md b/guava/README.md
index c67a3604ea..9c650dbc1d 100644
--- a/guava/README.md
+++ b/guava/README.md
@@ -12,4 +12,5 @@ This module contains articles a Google Guava
- [Guide to Mathematical Utilities in Guava](https://www.baeldung.com/guava-math)
- [Bloom Filter in Java using Guava](https://www.baeldung.com/guava-bloom-filter)
- [Quick Guide to the Guava RateLimiter](https://www.baeldung.com/guava-rate-limiter)
-
+- [Introduction to Guava Throwables](https://www.baeldung.com/guava-throwables)
+- [Guava Cache](https://www.baeldung.com/guava-cache)
diff --git a/guava/pom.xml b/guava/pom.xml
index 3f07b77b0b..df6d57bd09 100644
--- a/guava/pom.xml
+++ b/guava/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
guava
0.1.0-SNAPSHOT
diff --git a/guava/src/test/java/com/baeldung/guava/ThrowablesUnitTest.java b/guava/src/test/java/com/baeldung/guava/ThrowablesUnitTest.java
new file mode 100644
index 0000000000..7d33b38a0e
--- /dev/null
+++ b/guava/src/test/java/com/baeldung/guava/ThrowablesUnitTest.java
@@ -0,0 +1,44 @@
+package com.baeldung.guava;
+
+import com.google.common.base.Throwables;
+import org.junit.Test;
+
+import java.util.function.Supplier;
+
+public class ThrowablesUnitTest {
+
+ @Test(expected = RuntimeException.class)
+ public void whenThrowable_shouldWrapItInRuntimeException() throws Exception {
+ try {
+ throwThrowable(Throwable::new);
+ } catch (Throwable t) {
+ Throwables.propagateIfPossible(t, Exception.class);
+ throw new RuntimeException(t);
+ }
+ }
+
+ @Test(expected = Error.class)
+ public void whenError_shouldPropagateAsIs() throws Exception {
+ try {
+ throwThrowable(Error::new);
+ } catch (Throwable t) {
+ Throwables.propagateIfPossible(t, Exception.class);
+ throw new RuntimeException(t);
+ }
+ }
+
+ @Test(expected = Exception.class)
+ public void whenException_shouldPropagateAsIs() throws Exception {
+ try {
+ throwThrowable(Exception::new);
+ } catch (Throwable t) {
+ Throwables.propagateIfPossible(t, Exception.class);
+ throw new RuntimeException(t);
+ }
+ }
+
+ private void throwThrowable(Supplier exceptionSupplier) throws Throwable {
+ throw exceptionSupplier.get();
+ }
+
+}
diff --git a/guice/pom.xml b/guice/pom.xml
index d119bbf78e..6bbad6dddc 100644
--- a/guice/pom.xml
+++ b/guice/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
com.baeldung.examples.guice
guice
diff --git a/hazelcast/pom.xml b/hazelcast/pom.xml
index 10234bb81f..287542be33 100644
--- a/hazelcast/pom.xml
+++ b/hazelcast/pom.xml
@@ -1,6 +1,8 @@
-
+
4.0.0
hazelcast
0.0.1-SNAPSHOT
@@ -32,7 +34,7 @@
-
+
0.6
diff --git a/hystrix/pom.xml b/hystrix/pom.xml
index 8c505c9104..1cf8713b91 100644
--- a/hystrix/pom.xml
+++ b/hystrix/pom.xml
@@ -8,9 +8,9 @@
com.baeldung
- parent-boot-1
+ parent-boot-2
0.0.1-SNAPSHOT
- ../parent-boot-1
+ ../parent-boot-2
diff --git a/jackson-modules/jackson-conversions/src/test/java/com/baeldung/jackson/date/JacksonDateUnitTest.java b/jackson-modules/jackson-conversions/src/test/java/com/baeldung/jackson/date/JacksonDateUnitTest.java
index a264dd52f2..924ec1162f 100644
--- a/jackson-modules/jackson-conversions/src/test/java/com/baeldung/jackson/date/JacksonDateUnitTest.java
+++ b/jackson-modules/jackson-conversions/src/test/java/com/baeldung/jackson/date/JacksonDateUnitTest.java
@@ -1,6 +1,7 @@
package com.baeldung.jackson.date;
import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
@@ -8,6 +9,8 @@ import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
import java.util.Date;
import java.util.TimeZone;
@@ -30,7 +33,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
public class JacksonDateUnitTest {
@Test
- public void whenSerializingDateWithJackson_thenSerializedToNumber() throws JsonProcessingException, ParseException {
+ public void whenSerializingDateWithJackson_thenSerializedToTimestamp() throws JsonProcessingException, ParseException {
final SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy hh:mm");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
@@ -61,6 +64,21 @@ public class JacksonDateUnitTest {
final String result = mapper.writeValueAsString(event);
assertThat(result, containsString("1970-01-01T02:30:00.000+00:00"));
}
+
+ @Test
+ public void whenDeserialisingZonedDateTimeWithDefaults_thenNotCorrect()
+ throws IOException {
+ ObjectMapper objectMapper = new ObjectMapper();
+ objectMapper.findAndRegisterModules();
+ objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+ ZonedDateTime now = ZonedDateTime.now(ZoneId.of("UTC"));
+ String converted = objectMapper.writeValueAsString(now);
+
+ ZonedDateTime restored = objectMapper.readValue(converted, ZonedDateTime.class);
+ System.out.println("serialized: " + now);
+ System.out.println("restored: " + restored);
+ assertThat(now, is(restored));
+ }
@Test
public void whenSettingObjectMapperDateFormat_thenCorrect() throws JsonProcessingException, ParseException {
diff --git a/java-collections-maps-3/pom.xml b/java-collections-maps-3/pom.xml
new file mode 100644
index 0000000000..3888623a7f
--- /dev/null
+++ b/java-collections-maps-3/pom.xml
@@ -0,0 +1,43 @@
+
+
+
+ com.baeldung
+ parent-java
+ 0.0.1-SNAPSHOT
+ ../parent-java
+
+
+ 4.0.0
+ java-collections-maps-3
+ 0.1.0-SNAPSHOT
+ java-collections-maps-3
+ jar
+
+
+
+ org.springframework
+ spring-core
+ ${spring.version}
+ test
+
+
+ org.assertj
+ assertj-core
+ ${assertj.version}
+ test
+
+
+ org.apache.commons
+ commons-collections4
+ ${commons-collections4.version}
+
+
+
+
+ 4.1
+ 3.6.1
+ 5.2.5.RELEASE
+
+
diff --git a/java-collections-maps-3/src/test/java/com/baeldung/map/caseinsensitivekeys/CaseInsensitiveMapUnitTest.java b/java-collections-maps-3/src/test/java/com/baeldung/map/caseinsensitivekeys/CaseInsensitiveMapUnitTest.java
new file mode 100644
index 0000000000..833807c692
--- /dev/null
+++ b/java-collections-maps-3/src/test/java/com/baeldung/map/caseinsensitivekeys/CaseInsensitiveMapUnitTest.java
@@ -0,0 +1,94 @@
+package com.baeldung.map.caseinsensitivekeys;
+
+import org.apache.commons.collections4.map.CaseInsensitiveMap;
+import org.junit.Test;
+import org.springframework.util.LinkedCaseInsensitiveMap;
+import java.util.Map;
+import java.util.TreeMap;
+import static org.junit.Assert.*;
+
+public class CaseInsensitiveMapUnitTest {
+ @Test
+ public void givenCaseInsensitiveTreeMap_whenTwoEntriesAdded_thenSizeIsOne(){
+ Map treeMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
+ treeMap.put("abc", 1);
+ treeMap.put("ABC", 2);
+
+ assertEquals(1, treeMap.size());
+ }
+
+ @Test
+ public void givenCommonsCaseInsensitiveMap_whenTwoEntriesAdded_thenSizeIsOne(){
+ Map commonsHashMap = new CaseInsensitiveMap<>();
+ commonsHashMap.put("abc", 1);
+ commonsHashMap.put("ABC", 2);
+
+ assertEquals(1, commonsHashMap.size());
+ }
+
+ @Test
+ public void givenLinkedCaseInsensitiveMap_whenTwoEntriesAdded_thenSizeIsOne(){
+ Map linkedHashMap = new LinkedCaseInsensitiveMap<>();
+ linkedHashMap.put("abc", 1);
+ linkedHashMap.put("ABC", 2);
+
+ assertEquals(1, linkedHashMap.size());
+ }
+
+ @Test
+ public void givenCaseInsensitiveTreeMap_whenSameEntryAdded_thenValueUpdated(){
+ Map treeMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
+ treeMap.put("abc", 1);
+ treeMap.put("ABC", 2);
+
+ assertEquals(2, treeMap.get("aBc").intValue());
+ assertEquals(2, treeMap.get("ABc").intValue());
+ }
+
+ @Test
+ public void givenCommonsCaseInsensitiveMap_whenSameEntryAdded_thenValueUpdated(){
+ Map commonsHashMap = new CaseInsensitiveMap<>();
+ commonsHashMap.put("abc", 1);
+ commonsHashMap.put("ABC", 2);
+
+ assertEquals(2, commonsHashMap.get("aBc").intValue());
+ assertEquals(2, commonsHashMap.get("ABc").intValue());
+ }
+
+ @Test
+ public void givenLinkedCaseInsensitiveMap_whenSameEntryAdded_thenValueUpdated(){
+ Map linkedHashMap = new LinkedCaseInsensitiveMap<>();
+ linkedHashMap.put("abc", 1);
+ linkedHashMap.put("ABC", 2);
+
+ assertEquals(2, linkedHashMap.get("aBc").intValue());
+ assertEquals(2, linkedHashMap.get("ABc").intValue());
+ }
+
+ @Test
+ public void givenCaseInsensitiveTreeMap_whenEntryRemoved_thenSizeIsZero(){
+ Map treeMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
+ treeMap.put("abc", 3);
+ treeMap.remove("aBC");
+
+ assertEquals(0, treeMap.size());
+ }
+
+ @Test
+ public void givenCommonsCaseInsensitiveMap_whenEntryRemoved_thenSizeIsZero(){
+ Map commonsHashMap = new CaseInsensitiveMap<>();
+ commonsHashMap.put("abc", 3);
+ commonsHashMap.remove("aBC");
+
+ assertEquals(0, commonsHashMap.size());
+ }
+
+ @Test
+ public void givenLinkedCaseInsensitiveMap_whenEntryRemoved_thenSizeIsZero(){
+ Map linkedHashMap = new LinkedCaseInsensitiveMap<>();
+ linkedHashMap.put("abc", 3);
+ linkedHashMap.remove("aBC");
+
+ assertEquals(0, linkedHashMap.size());
+ }
+}
diff --git a/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml b/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml
index a2d9443d67..f8d19b5750 100644
--- a/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml
+++ b/java-ee-8-security-api/app-auth-form-store-ldap/pom.xml
@@ -1,7 +1,8 @@
-
+
4.0.0
app-auth-form-store-ldap
app-auth-form-store-ldap
@@ -12,10 +13,6 @@
java-ee-8-security-api
1.0-SNAPSHOT
-
-
- 4.0.4
-
@@ -52,4 +49,8 @@
+
+ 4.0.4
+
+
diff --git a/java-math-2/README.md b/java-math-2/README.md
deleted file mode 100644
index ca809e8623..0000000000
--- a/java-math-2/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-## Java Math
-
-This module contains articles about math in Java.
-
-### Relevant articles:
-
-- [Basic Calculator in Java](https://www.baeldung.com/basic-calculator-in-java)
-- More articles: [[<-- prev]](/../java-math)
diff --git a/java-numbers-2/README.md b/java-numbers-2/README.md
index ba9e14965d..1d996e32cc 100644
--- a/java-numbers-2/README.md
+++ b/java-numbers-2/README.md
@@ -13,7 +13,4 @@ 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-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)
+- More articles: [[<-- prev]](/java-numbers) [[next -->]](/java-numbers-3)
diff --git a/java-numbers-3/README.md b/java-numbers-3/README.md
index 835b8b0b54..f818bdb675 100644
--- a/java-numbers-3/README.md
+++ b/java-numbers-3/README.md
@@ -1,5 +1,14 @@
+## Java Number Cookbooks and Examples
+
+This module contains articles about numbers in Java.
+
### Relevant Articles:
- [Generating Random Numbers](https://www.baeldung.com/java-generating-random-numbers)
- [Convert Double to Long in Java](https://www.baeldung.com/java-convert-double-long)
- [Check for null Before Calling Parse in Double.parseDouble](https://www.baeldung.com/java-check-null-parse-double)
+- [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)
+- [Guide to the Number Class in Java](https://www.baeldung.com/java-number-class)
+- More articles: [[<-- prev]](/java-numbers-2)
diff --git a/java-numbers-2/src/main/java/com/baeldung/fibonacci/FibonacciSeriesUtils.java b/java-numbers-3/src/main/java/com/baeldung/fibonacci/FibonacciSeriesUtils.java
similarity index 96%
rename from java-numbers-2/src/main/java/com/baeldung/fibonacci/FibonacciSeriesUtils.java
rename to java-numbers-3/src/main/java/com/baeldung/fibonacci/FibonacciSeriesUtils.java
index 943fcffa56..616f3ab28f 100644
--- a/java-numbers-2/src/main/java/com/baeldung/fibonacci/FibonacciSeriesUtils.java
+++ b/java-numbers-3/src/main/java/com/baeldung/fibonacci/FibonacciSeriesUtils.java
@@ -1,7 +1,5 @@
package com.baeldung.fibonacci;
-import static java.lang.Math.pow;
-
public class FibonacciSeriesUtils {
public static int nthFibonacciTermRecursiveMethod(int n) {
diff --git a/java-numbers-2/src/main/java/com/baeldung/numbersinrange/NumbersInARange.java b/java-numbers-3/src/main/java/com/baeldung/numbersinrange/NumbersInARange.java
similarity index 100%
rename from java-numbers-2/src/main/java/com/baeldung/numbersinrange/NumbersInARange.java
rename to java-numbers-3/src/main/java/com/baeldung/numbersinrange/NumbersInARange.java
diff --git a/java-numbers-2/src/main/java/com/baeldung/numbersinrange/RandomNumbersInARange.java b/java-numbers-3/src/main/java/com/baeldung/numbersinrange/RandomNumbersInARange.java
similarity index 100%
rename from java-numbers-2/src/main/java/com/baeldung/numbersinrange/RandomNumbersInARange.java
rename to java-numbers-3/src/main/java/com/baeldung/numbersinrange/RandomNumbersInARange.java
diff --git a/java-numbers-3/src/test/java/com/baeldung/abstractnumber/AbstractNumberUnitTest.java b/java-numbers-3/src/test/java/com/baeldung/abstractnumber/AbstractNumberUnitTest.java
new file mode 100644
index 0000000000..521f2d37a6
--- /dev/null
+++ b/java-numbers-3/src/test/java/com/baeldung/abstractnumber/AbstractNumberUnitTest.java
@@ -0,0 +1,52 @@
+package com.baeldung.abstractnumber;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+public class AbstractNumberUnitTest {
+
+ private final static double DOUBLE_VALUE = 9999.999;
+ private final static float FLOAT_VALUE = 101.99F;
+ private final static long LONG_VALUE = 1000L;
+ private final static int INTEGER_VALUE = 100;
+ private final static short SHORT_VALUE = 127;
+ private final static byte BYTE_VALUE = 120;
+
+ @Test
+ public void givenDoubleValue_whenShortValueUsed_thenShortValueReturned() {
+ Double doubleValue = Double.valueOf(DOUBLE_VALUE);
+ assertEquals(9999, doubleValue.shortValue());
+ }
+
+ @Test
+ public void givenFloatValue_whenByteValueUsed_thenByteValueReturned() {
+ Float floatValue = Float.valueOf(FLOAT_VALUE);
+ assertEquals(101, floatValue.byteValue());
+ }
+
+ @Test
+ public void givenLongValue_whenInitValueUsed_thenInitValueReturned() {
+ Long longValue = Long.valueOf(LONG_VALUE);
+ assertEquals(1000, longValue.intValue());
+ }
+
+ @Test
+ public void givenIntegerValue_whenLongValueUsed_thenLongValueReturned() {
+ Integer integerValue = Integer.valueOf(INTEGER_VALUE);
+ assertEquals(100, integerValue.longValue());
+ }
+
+ @Test
+ public void givenShortValue_whenFloatValueUsed_thenFloatValueReturned() {
+ Short shortValue = Short.valueOf(SHORT_VALUE);
+ assertEquals(127.0F, shortValue.floatValue(), 0);
+ }
+
+ @Test
+ public void givenByteValue_whenDoubleValueUsed_thenDoubleValueReturned() {
+ Byte byteValue = Byte.valueOf(BYTE_VALUE);
+ assertEquals(120.0, byteValue.doubleValue(), 0);
+ }
+
+}
diff --git a/java-numbers-2/src/test/java/com/baeldung/fibonacci/FibonacciSeriesUtilsUnitTest.java b/java-numbers-3/src/test/java/com/baeldung/fibonacci/FibonacciSeriesUtilsUnitTest.java
similarity index 100%
rename from java-numbers-2/src/test/java/com/baeldung/fibonacci/FibonacciSeriesUtilsUnitTest.java
rename to java-numbers-3/src/test/java/com/baeldung/fibonacci/FibonacciSeriesUtilsUnitTest.java
diff --git a/java-numbers-2/src/test/java/com/baeldung/numbersinrange/NumbersInARangeUnitTest.java b/java-numbers-3/src/test/java/com/baeldung/numbersinrange/NumbersInARangeUnitTest.java
similarity index 100%
rename from java-numbers-2/src/test/java/com/baeldung/numbersinrange/NumbersInARangeUnitTest.java
rename to java-numbers-3/src/test/java/com/baeldung/numbersinrange/NumbersInARangeUnitTest.java
diff --git a/java-numbers-2/src/test/java/com/baeldung/numbersinrange/RandomNumbersInARangeUnitTest.java b/java-numbers-3/src/test/java/com/baeldung/numbersinrange/RandomNumbersInARangeUnitTest.java
similarity index 100%
rename from java-numbers-2/src/test/java/com/baeldung/numbersinrange/RandomNumbersInARangeUnitTest.java
rename to java-numbers-3/src/test/java/com/baeldung/numbersinrange/RandomNumbersInARangeUnitTest.java
diff --git a/java-numbers/README.md b/java-numbers/README.md
index eee6fceab1..f4b76c3c98 100644
--- a/java-numbers/README.md
+++ b/java-numbers/README.md
@@ -8,9 +8,9 @@ This module contains articles about numbers in Java.
- [BigDecimal and BigInteger in Java](http://www.baeldung.com/java-bigdecimal-biginteger)
- [Find All Pairs of Numbers in an Array That Add Up to a Given Sum](http://www.baeldung.com/java-algorithm-number-pairs-sum)
- [Java – Random Long, Float, Integer and Double](http://www.baeldung.com/java-generate-random-long-float-integer-double)
-- [Using Math.sin with Degrees](https://www.baeldung.com/java-math-sin-degrees)
- [A Practical Guide to DecimalFormat](http://www.baeldung.com/java-decimalformat)
- [Calculating the nth Root in Java](https://www.baeldung.com/java-nth-root)
- [Convert Double to String, Removing Decimal Places](https://www.baeldung.com/java-double-to-string)
- [Changing the Order in a Sum Operation Can Produce Different Results?](https://www.baeldung.com/java-floating-point-sum-order)
+- [Using Math.sin with Degrees](https://www.baeldung.com/java-math-sin-degrees)
- More articles: [[next -->]](/../java-numbers-2)
diff --git a/jee-7/pom.xml b/jee-7/pom.xml
index a2593e46a5..9077aae1a6 100644
--- a/jee-7/pom.xml
+++ b/jee-7/pom.xml
@@ -242,6 +242,28 @@
+
+
+ org.codehaus.mojo
+ jaxws-maven-plugin
+ 2.6
+
+
+ wsimport-from-jdk
+
+ wsimport
+
+
+
+
+
+ http://localhost:8888/ws/country?wsdl
+
+ true
+ com.baeldung.soap.ws.client.generated
+ src/main/java
+
+
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Country.java b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Country.java
new file mode 100644
index 0000000000..6a810b9afa
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Country.java
@@ -0,0 +1,129 @@
+
+package com.baeldung.soap.ws.client.generated;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Java class for country complex type.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * <complexType name="country">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="capital" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="currency" type="{http://server.ws.soap.baeldung.com/}currency" minOccurs="0"/>
+ * <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="population" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ *
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "country", propOrder = { "capital", "currency", "name", "population" })
+public class Country {
+
+ protected String capital;
+ @XmlSchemaType(name = "string")
+ protected Currency currency;
+ protected String name;
+ protected int population;
+
+ /**
+ * Gets the value of the capital property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCapital() {
+ return capital;
+ }
+
+ /**
+ * Sets the value of the capital property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCapital(String value) {
+ this.capital = value;
+ }
+
+ /**
+ * Gets the value of the currency property.
+ *
+ * @return
+ * possible object is
+ * {@link Currency }
+ *
+ */
+ public Currency getCurrency() {
+ return currency;
+ }
+
+ /**
+ * Sets the value of the currency property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Currency }
+ *
+ */
+ public void setCurrency(Currency value) {
+ this.currency = value;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the population property.
+ *
+ */
+ public int getPopulation() {
+ return population;
+ }
+
+ /**
+ * Sets the value of the population property.
+ *
+ */
+ public void setPopulation(int value) {
+ this.population = value;
+ }
+
+}
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java
new file mode 100644
index 0000000000..bda4a305a5
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryService.java
@@ -0,0 +1,34 @@
+
+package com.baeldung.soap.ws.client.generated;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.ws.Action;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.3.2
+ * Generated source version: 2.2
+ *
+ */
+@WebService(name = "CountryService", targetNamespace = "http://server.ws.soap.baeldung.com/")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@XmlSeeAlso({ ObjectFactory.class })
+public interface CountryService {
+
+ /**
+ *
+ * @param arg0
+ * @return
+ * returns com.baeldung.soap.ws.client.generated.Country
+ */
+ @WebMethod
+ @WebResult(partName = "return")
+ @Action(input = "http://server.ws.soap.baeldung.com/CountryService/findByNameRequest", output = "http://server.ws.soap.baeldung.com/CountryService/findByNameResponse")
+ public Country findByName(@WebParam(name = "arg0", partName = "arg0") String arg0);
+
+}
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java
new file mode 100644
index 0000000000..a6983938f5
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/CountryServiceImplService.java
@@ -0,0 +1,91 @@
+
+package com.baeldung.soap.ws.client.generated;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.2.9-b130926.1035
+ * Generated source version: 2.2
+ *
+ */
+@WebServiceClient(name = "CountryServiceImplService", targetNamespace = "http://server.ws.soap.baeldung.com/", wsdlLocation = "http://localhost:8888/ws/country?wsdl")
+public class CountryServiceImplService extends Service {
+
+ private final static URL COUNTRYSERVICEIMPLSERVICE_WSDL_LOCATION;
+ private final static WebServiceException COUNTRYSERVICEIMPLSERVICE_EXCEPTION;
+ private final static QName COUNTRYSERVICEIMPLSERVICE_QNAME = new QName("http://server.ws.soap.baeldung.com/", "CountryServiceImplService");
+
+ static {
+ URL url = null;
+ WebServiceException e = null;
+ try {
+ url = new URL("http://localhost:8888/ws/country?wsdl");
+ } catch (MalformedURLException ex) {
+ e = new WebServiceException(ex);
+ }
+ COUNTRYSERVICEIMPLSERVICE_WSDL_LOCATION = url;
+ COUNTRYSERVICEIMPLSERVICE_EXCEPTION = e;
+ }
+
+ public CountryServiceImplService() {
+ super(__getWsdlLocation(), COUNTRYSERVICEIMPLSERVICE_QNAME);
+ }
+
+ public CountryServiceImplService(WebServiceFeature... features) {
+ super(__getWsdlLocation(), COUNTRYSERVICEIMPLSERVICE_QNAME, features);
+ }
+
+ public CountryServiceImplService(URL wsdlLocation) {
+ super(wsdlLocation, COUNTRYSERVICEIMPLSERVICE_QNAME);
+ }
+
+ public CountryServiceImplService(URL wsdlLocation, WebServiceFeature... features) {
+ super(wsdlLocation, COUNTRYSERVICEIMPLSERVICE_QNAME, features);
+ }
+
+ public CountryServiceImplService(URL wsdlLocation, QName serviceName) {
+ super(wsdlLocation, serviceName);
+ }
+
+ public CountryServiceImplService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
+ super(wsdlLocation, serviceName, features);
+ }
+
+ /**
+ *
+ * @return
+ * returns CountryService
+ */
+ @WebEndpoint(name = "CountryServiceImplPort")
+ public CountryService getCountryServiceImplPort() {
+ return super.getPort(new QName("http://server.ws.soap.baeldung.com/", "CountryServiceImplPort"), CountryService.class);
+ }
+
+ /**
+ *
+ * @param features
+ * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features
parameter will have their default values.
+ * @return
+ * returns CountryService
+ */
+ @WebEndpoint(name = "CountryServiceImplPort")
+ public CountryService getCountryServiceImplPort(WebServiceFeature... features) {
+ return super.getPort(new QName("http://server.ws.soap.baeldung.com/", "CountryServiceImplPort"), CountryService.class, features);
+ }
+
+ private static URL __getWsdlLocation() {
+ if (COUNTRYSERVICEIMPLSERVICE_EXCEPTION != null) {
+ throw COUNTRYSERVICEIMPLSERVICE_EXCEPTION;
+ }
+ return COUNTRYSERVICEIMPLSERVICE_WSDL_LOCATION;
+ }
+
+}
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java
new file mode 100644
index 0000000000..8b9355edc5
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/Currency.java
@@ -0,0 +1,37 @@
+
+package com.baeldung.soap.ws.client.generated;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Java class for currency.
+ *
+ *
The following schema fragment specifies the expected content contained within this class.
+ *
+ *
+ * <simpleType name="currency">
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ * <enumeration value="EUR"/>
+ * <enumeration value="INR"/>
+ * <enumeration value="USD"/>
+ * </restriction>
+ * </simpleType>
+ *
+ *
+ */
+@XmlType(name = "currency")
+@XmlEnum
+public enum Currency {
+
+ EUR, INR, USD;
+
+ public String value() {
+ return name();
+ }
+
+ public static Currency fromValue(String v) {
+ return valueOf(v);
+ }
+
+}
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java
new file mode 100644
index 0000000000..241debe758
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/ObjectFactory.java
@@ -0,0 +1,38 @@
+
+package com.baeldung.soap.ws.client.generated;
+
+import javax.xml.bind.annotation.XmlRegistry;
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the com.baeldung.soap.ws.client.generated package.
+ * An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory {
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.baeldung.soap.ws.client.generated
+ *
+ */
+ public ObjectFactory() {
+ }
+
+ /**
+ * Create an instance of {@link Country }
+ *
+ */
+ public Country createCountry() {
+ return new Country();
+ }
+
+}
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java
new file mode 100644
index 0000000000..6df70b70f1
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/client/generated/package-info.java
@@ -0,0 +1,2 @@
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://server.ws.soap.baeldung.com/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package com.baeldung.soap.ws.client.generated;
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/Country.java b/jee-7/src/main/java/com/baeldung/soap/ws/server/Country.java
new file mode 100644
index 0000000000..62ea4a22ed
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/server/Country.java
@@ -0,0 +1,41 @@
+package com.baeldung.soap.ws.server;
+
+public class Country {
+ protected String name;
+ protected int population;
+ protected String capital;
+ protected Currency currency;
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getPopulation() {
+ return population;
+ }
+
+ public void setPopulation(int population) {
+ this.population = population;
+ }
+
+ public String getCapital() {
+ return capital;
+ }
+
+ public void setCapital(String capital) {
+ this.capital = capital;
+ }
+
+ public Currency getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(Currency currency) {
+ this.currency = currency;
+ }
+
+}
\ No newline at end of file
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryRepository.java b/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryRepository.java
new file mode 100644
index 0000000000..558f7c1293
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryRepository.java
@@ -0,0 +1,43 @@
+package com.baeldung.soap.ws.server;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class CountryRepository {
+
+ private static final Map countries = new HashMap<>();
+
+ {
+ initData();
+ }
+
+ private final static void initData() {
+ Country usa = new Country();
+ usa.setName("USA");
+ usa.setCapital("Washington D.C.");
+ usa.setCurrency(Currency.USD);
+ usa.setPopulation(323947000);
+
+ countries.put(usa.getName(), usa);
+
+ Country india = new Country();
+ india.setName("India");
+ india.setCapital("New Delhi");
+ india.setCurrency(Currency.INR);
+ india.setPopulation(1295210000);
+
+ countries.put(india.getName(), india);
+
+ Country france = new Country();
+ france.setName("France");
+ france.setCapital("Paris");
+ france.setCurrency(Currency.EUR);
+ france.setPopulation(66710000);
+
+ countries.put(france.getName(), france);
+ }
+
+ public Country findCountry(String name) {
+ return countries.get(name);
+ }
+}
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryService.java b/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryService.java
new file mode 100644
index 0000000000..e3f68a4e59
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryService.java
@@ -0,0 +1,15 @@
+package com.baeldung.soap.ws.server;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+@WebService
+@SOAPBinding(style=Style.RPC)
+public interface CountryService {
+
+ @WebMethod
+ Country findByName(String name);
+
+}
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServiceImpl.java b/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServiceImpl.java
new file mode 100644
index 0000000000..a8c6250354
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServiceImpl.java
@@ -0,0 +1,15 @@
+package com.baeldung.soap.ws.server;
+
+import javax.jws.WebService;
+
+@WebService(endpointInterface = "com.baeldung.soap.ws.server.CountryService")
+public class CountryServiceImpl implements CountryService {
+
+ private CountryRepository countryRepository = new CountryRepository();
+
+ @Override
+ public Country findByName(String name) {
+ return countryRepository.findCountry(name);
+ }
+
+}
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServicePublisher.java b/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServicePublisher.java
new file mode 100644
index 0000000000..e7c1c480f4
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/server/CountryServicePublisher.java
@@ -0,0 +1,19 @@
+package com.baeldung.soap.ws.server;
+
+import javax.xml.ws.Endpoint;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+public class CountryServicePublisher {
+
+ private static final Logger logger = LoggerFactory.getLogger(CountryServicePublisher.class);
+
+ public static void main(String[] args) {
+ Endpoint endpoint = Endpoint.create(new CountryServiceImpl());
+ endpoint.publish("http://localhost:8888/ws/country");
+
+ logger.info("Country web service ready to consume requests!");
+ }
+}
\ No newline at end of file
diff --git a/jee-7/src/main/java/com/baeldung/soap/ws/server/Currency.java b/jee-7/src/main/java/com/baeldung/soap/ws/server/Currency.java
new file mode 100644
index 0000000000..d1b25a26c6
--- /dev/null
+++ b/jee-7/src/main/java/com/baeldung/soap/ws/server/Currency.java
@@ -0,0 +1,15 @@
+package com.baeldung.soap.ws.server;
+
+public enum Currency {
+
+ EUR, INR, USD;
+
+ public String value() {
+ return name();
+ }
+
+ public static Currency fromValue(String v) {
+ return valueOf(v);
+ }
+
+}
diff --git a/jee-7/src/main/resources/country.xsd b/jee-7/src/main/resources/country.xsd
new file mode 100644
index 0000000000..c94b6047f9
--- /dev/null
+++ b/jee-7/src/main/resources/country.xsd
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointUnitTest.java
index 744bdfc8f5..c607efeb24 100644
--- a/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointUnitTest.java
+++ b/jee-7/src/test/java/com/baeldung/batch/understanding/CustomCheckPointUnitTest.java
@@ -1,20 +1,17 @@
package com.baeldung.batch.understanding;
-import static org.junit.jupiter.api.Assertions.*;
-import java.util.Map;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
import java.util.Properties;
+
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
-import javax.batch.runtime.Metric;
import javax.batch.runtime.StepExecution;
-import com.baeldung.batch.understanding.BatchTestHelper;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.Disabled;
-@Disabled("Should be fixed in BAEL-3812")
class CustomCheckPointUnitTest {
@Test
public void givenChunk_whenCustomCheckPoint_thenCommitCountIsThree() throws Exception {
diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceUnitTest.java
index 88b981df92..4b27e5f5ec 100644
--- a/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceUnitTest.java
+++ b/jee-7/src/test/java/com/baeldung/batch/understanding/JobSequenceUnitTest.java
@@ -1,6 +1,8 @@
package com.baeldung.batch.understanding;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.List;
@@ -13,9 +15,7 @@ import javax.batch.runtime.JobExecution;
import javax.batch.runtime.StepExecution;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.Disabled;
-@Disabled("Should be fixed in BAEL-3812")
class JobSequenceUnitTest {
@Test
public void givenTwoSteps_thenBatch_CompleteWithSuccess() throws Exception {
diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java
index 3babf9b5aa..788b75eb3e 100644
--- a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java
+++ b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleBatchLetUnitTest.java
@@ -1,17 +1,16 @@
package com.baeldung.batch.understanding;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.util.Properties;
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
-import java.util.Properties;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.junit.jupiter.api.Test;
-@Disabled("Should be fixed in BAEL-3812")
class SimpleBatchLetUnitTest {
@Test
public void givenBatchLet_thenBatch_CompleteWithSuccess() throws Exception {
diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkUnitTest.java
index 5871143fa3..9010c365a2 100644
--- a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkUnitTest.java
+++ b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleChunkUnitTest.java
@@ -1,6 +1,7 @@
package com.baeldung.batch.understanding;
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.List;
import java.util.Map;
@@ -14,9 +15,7 @@ import javax.batch.runtime.Metric;
import javax.batch.runtime.StepExecution;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.Disabled;
-@Disabled("Should be fixed in BAEL-3812")
class SimpleChunkUnitTest {
@Test
public void givenChunk_thenBatch_CompletesWithSucess() throws Exception {
diff --git a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java
index c53561a0c0..bc410aec8d 100644
--- a/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java
+++ b/jee-7/src/test/java/com/baeldung/batch/understanding/SimpleErrorChunkUnitTest.java
@@ -1,19 +1,18 @@
package com.baeldung.batch.understanding;
-import org.junit.jupiter.api.Disabled;
-import org.junit.jupiter.api.Test;
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+import java.util.Properties;
import javax.batch.operations.JobOperator;
import javax.batch.runtime.BatchRuntime;
import javax.batch.runtime.BatchStatus;
import javax.batch.runtime.JobExecution;
import javax.batch.runtime.StepExecution;
-import java.util.List;
-import java.util.Properties;
-import static org.junit.Assert.assertEquals;
+import org.junit.jupiter.api.Test;
-@Disabled("Should be fixed in BAEL-3812")
class SimpleErrorChunkUnitTest {
@Test
diff --git a/jee-7/src/test/java/com/baeldung/soap/ws/client/CountryClientLiveTest.java b/jee-7/src/test/java/com/baeldung/soap/ws/client/CountryClientLiveTest.java
new file mode 100644
index 0000000000..ae423f9bdd
--- /dev/null
+++ b/jee-7/src/test/java/com/baeldung/soap/ws/client/CountryClientLiveTest.java
@@ -0,0 +1,39 @@
+package com.baeldung.soap.ws.client;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.baeldung.soap.ws.client.generated.CountryService;
+import com.baeldung.soap.ws.client.generated.CountryServiceImplService;
+import com.baeldung.soap.ws.client.generated.Currency;
+
+//Ensure that com.baeldung.soap.ws.server.CountryServicePublisher is running before executing this test
+public class CountryClientLiveTest {
+
+ private static CountryService countryService;
+
+ @BeforeClass
+ public static void setup() {
+ CountryServiceImplService service = new CountryServiceImplService();
+ countryService = service.getCountryServiceImplPort();
+ }
+
+ @Test
+ public void givenCountryService_whenCountryIndia_thenCapitalIsNewDelhi() {
+ assertEquals("New Delhi", countryService.findByName("India").getCapital());
+ }
+
+ @Test
+ public void givenCountryService_whenCountryFrance_thenPopulationCorrect() {
+ assertEquals(66710000, countryService.findByName("France").getPopulation());
+ }
+
+ @Test
+ public void givenCountryService_whenCountryUSA_thenCurrencyUSD() {
+ assertEquals(Currency.USD, countryService.findByName("USA").getCurrency());
+ }
+
+
+}
diff --git a/jee-7/src/test/resources/jberet.properties b/jee-7/src/test/resources/jberet.properties
new file mode 100644
index 0000000000..e8b9907de5
--- /dev/null
+++ b/jee-7/src/test/resources/jberet.properties
@@ -0,0 +1 @@
+db-url=jdbc:h2:mem:jberet-repo;DB_CLOSE_DELAY=-1
\ No newline at end of file
diff --git a/jgit/pom.xml b/jgit/pom.xml
index eef3c9b8e8..d960843868 100644
--- a/jgit/pom.xml
+++ b/jgit/pom.xml
@@ -2,9 +2,9 @@
4.0.0
- JGit
+ jgit
1.0-SNAPSHOT
- JGit
+ jgit
jar
http://maven.apache.org
diff --git a/jgit/src/test/java/com/baeldung/jgit/JGitBugIntegrationTest.java b/jgit/src/test/java/com/baeldung/jgit/JGitBugManualTest.java
similarity index 67%
rename from jgit/src/test/java/com/baeldung/jgit/JGitBugIntegrationTest.java
rename to jgit/src/test/java/com/baeldung/jgit/JGitBugManualTest.java
index ad34890996..bcfe615bc7 100644
--- a/jgit/src/test/java/com/baeldung/jgit/JGitBugIntegrationTest.java
+++ b/jgit/src/test/java/com/baeldung/jgit/JGitBugManualTest.java
@@ -10,10 +10,18 @@ import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertNotNull;
-/**
- * Tests which show issues with JGit that we reported upstream.
- */
-public class JGitBugIntegrationTest {
+public class JGitBugManualTest {
+
+ /**
+ * This test case expects one git repository to be present in local file system.
+ * Currently this test uses the Baeldung repository i.e. the current checkout repository.
+ * It finds the repository by tracking back and scan file system to find .git folder in
+ * the file system.
+ *
+ * Before running the test case ensure that the .git folder is present.
+ *
+ * @throws IOException
+ */
@Test
public void testRevWalkDisposeClosesReader() throws IOException {
try (Repository repo = Helper.openJGitRepository()) {
diff --git a/jhipster-5/bookstore-monolith/pom.xml b/jhipster-5/bookstore-monolith/pom.xml
index 5eaf761921..233765e0f3 100644
--- a/jhipster-5/bookstore-monolith/pom.xml
+++ b/jhipster-5/bookstore-monolith/pom.xml
@@ -7,7 +7,7 @@
0.0.1-SNAPSHOT
war
Bookstore
-
+
jhipster-5
com.baeldung.jhipster
@@ -982,7 +982,7 @@
com.github.eirslett
- frontend-maven-plugin
+ frontend-maven-plugin
${frontend-maven-plugin.version}
install-node-and-npm
diff --git a/jhipster-5/bookstore-monolith/src/test/java/com/baeldung/jhipster5/service/mapper/UserMapperUnitTest.java b/jhipster-5/bookstore-monolith/src/test/java/com/baeldung/jhipster5/service/mapper/UserMapperIntegrationTest.java
similarity index 99%
rename from jhipster-5/bookstore-monolith/src/test/java/com/baeldung/jhipster5/service/mapper/UserMapperUnitTest.java
rename to jhipster-5/bookstore-monolith/src/test/java/com/baeldung/jhipster5/service/mapper/UserMapperIntegrationTest.java
index cd6a326c06..cd49135d63 100644
--- a/jhipster-5/bookstore-monolith/src/test/java/com/baeldung/jhipster5/service/mapper/UserMapperUnitTest.java
+++ b/jhipster-5/bookstore-monolith/src/test/java/com/baeldung/jhipster5/service/mapper/UserMapperIntegrationTest.java
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = BookstoreApp.class)
-public class UserMapperUnitTest {
+public class UserMapperIntegrationTest {
private static final String DEFAULT_LOGIN = "johndoe";
diff --git a/jhipster-5/pom.xml b/jhipster-5/pom.xml
index cebbe25d8b..2a5132e50e 100644
--- a/jhipster-5/pom.xml
+++ b/jhipster-5/pom.xml
@@ -9,10 +9,10 @@
pom
- parent-boot-1
+ parent-boot-2
com.baeldung
0.0.1-SNAPSHOT
- ../parent-boot-1
+ ../parent-boot-2
diff --git a/jjwt/pom.xml b/jjwt/pom.xml
index 073f12a922..aa238fafb5 100644
--- a/jjwt/pom.xml
+++ b/jjwt/pom.xml
@@ -10,9 +10,9 @@
com.baeldung
- parent-boot-1
+ parent-boot-2
0.0.1-SNAPSHOT
- ../parent-boot-1
+ ../parent-boot-2
@@ -30,6 +30,11 @@
org.springframework.boot
spring-boot-starter-security