From f2c2287b65bcdedadea7e2d492956b2f8eb88dac Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Tue, 14 Aug 2018 08:47:47 +0530 Subject: [PATCH 1/2] BAEL-8143 Update Mockito articles -Upgraded mockito version to 2.21.0 --- aws/pom.xml | 2 +- ethereum/pom.xml | 2 +- javax-servlets/pom.xml | 2 +- pom.xml | 2 +- spring-core/pom.xml | 2 +- spring-mockito/pom.xml | 2 +- testing-modules/mockito-2/pom.xml | 2 +- testing-modules/mocks/mock-comparisons/pom.xml | 2 +- testing-modules/test-containers/pom.xml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/aws/pom.xml b/aws/pom.xml index 176ecaa40d..26bc0c8037 100644 --- a/aws/pom.xml +++ b/aws/pom.xml @@ -137,7 +137,7 @@ 1.1.0 2.8.0 1.11.290 - 2.8.9 + 2.21.0 3.8.0 1.11.86 https://s3-us-west-2.amazonaws.com/dynamodb-local/release diff --git a/ethereum/pom.xml b/ethereum/pom.xml index f07ed2c6a0..434898635f 100644 --- a/ethereum/pom.xml +++ b/ethereum/pom.xml @@ -213,7 +213,7 @@ 3.3.1 5.0.5.RELEASE 1.5.6.RELEASE - 1.10.19 + 2.21.0 2.5.0 1.3 2.9.3 diff --git a/javax-servlets/pom.xml b/javax-servlets/pom.xml index afee807428..7b4eecd880 100644 --- a/javax-servlets/pom.xml +++ b/javax-servlets/pom.xml @@ -84,7 +84,7 @@ 5.0.5.RELEASE 2.8.2 3.9.1 - 2.18.3 + 2.21.0 1.3.3 2.6 4.0.1 diff --git a/pom.xml b/pom.xml index 978e27f055..98e0066597 100644 --- a/pom.xml +++ b/pom.xml @@ -1239,7 +1239,7 @@ 4.12 1.3 - 2.8.9 + 2.21.0 1.7.21 1.1.7 diff --git a/spring-core/pom.xml b/spring-core/pom.xml index 9e885462f3..708ba7c5a2 100644 --- a/spring-core/pom.xml +++ b/spring-core/pom.xml @@ -90,7 +90,7 @@ - 1.10.19 + 2.21.0 1.4.4.RELEASE 1 20.0 diff --git a/spring-mockito/pom.xml b/spring-mockito/pom.xml index 6aeaa9a1e8..a7a1c834ed 100644 --- a/spring-mockito/pom.xml +++ b/spring-mockito/pom.xml @@ -30,7 +30,7 @@ - 1.10.19 + 2.21.0 diff --git a/testing-modules/mockito-2/pom.xml b/testing-modules/mockito-2/pom.xml index 4b7dc70155..cab4d7977b 100644 --- a/testing-modules/mockito-2/pom.xml +++ b/testing-modules/mockito-2/pom.xml @@ -15,6 +15,6 @@ - 2.8.9 + 2.21.0 diff --git a/testing-modules/mocks/mock-comparisons/pom.xml b/testing-modules/mocks/mock-comparisons/pom.xml index 9424757a7a..df54db0c70 100644 --- a/testing-modules/mocks/mock-comparisons/pom.xml +++ b/testing-modules/mocks/mock-comparisons/pom.xml @@ -46,7 +46,7 @@ - 2.9.0 + 2.21.0 3.5.1 1.34 diff --git a/testing-modules/test-containers/pom.xml b/testing-modules/test-containers/pom.xml index 0ace187555..1f4c483988 100644 --- a/testing-modules/test-containers/pom.xml +++ b/testing-modules/test-containers/pom.xml @@ -104,7 +104,7 @@ 4.12.1 2.8.2 1.4.196 - 2.11.0 + 2.21.0 5.0.1.RELEASE 1.7.2 42.2.2 From fb61a7ea3af3d3cda883f6406630a8862e4d2c8a Mon Sep 17 00:00:00 2001 From: Dhawal Kapil Date: Thu, 16 Aug 2018 14:33:58 +0530 Subject: [PATCH 2/2] BAEL-8143 Update Mockito articles -Mockito version fixes -MessageMatcher implementation changed as ArugmentMatcher is an Interface now --- spring-core/pom.xml | 13 ------------- spring-mockito/pom.xml | 2 +- .../baeldung/domain/util/MessageMatcher.java | 19 +++++++------------ 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/spring-core/pom.xml b/spring-core/pom.xml index 708ba7c5a2..60f3262f08 100644 --- a/spring-core/pom.xml +++ b/spring-core/pom.xml @@ -16,11 +16,6 @@ - - org.mockito - mockito-all - ${mockito.version} - org.springframework spring-test @@ -82,15 +77,7 @@ - - - java.net - https://maven.java.net/content/repositories/releases/ - - - - 2.21.0 1.4.4.RELEASE 1 20.0 diff --git a/spring-mockito/pom.xml b/spring-mockito/pom.xml index a7a1c834ed..d1fa7f410e 100644 --- a/spring-mockito/pom.xml +++ b/spring-mockito/pom.xml @@ -24,7 +24,7 @@ org.mockito - mockito-all + mockito-core ${mockito.version} diff --git a/spring-mockito/src/main/java/com/baeldung/domain/util/MessageMatcher.java b/spring-mockito/src/main/java/com/baeldung/domain/util/MessageMatcher.java index 05cb43e4df..51db07fde7 100644 --- a/spring-mockito/src/main/java/com/baeldung/domain/util/MessageMatcher.java +++ b/spring-mockito/src/main/java/com/baeldung/domain/util/MessageMatcher.java @@ -3,7 +3,7 @@ package com.baeldung.domain.util; import com.baeldung.domain.model.Message; import org.mockito.ArgumentMatcher; -public class MessageMatcher extends ArgumentMatcher { +public class MessageMatcher implements ArgumentMatcher { private Message left; @@ -12,16 +12,11 @@ public class MessageMatcher extends ArgumentMatcher { } @Override - public boolean matches(Object object) { - if (object instanceof Message) { - Message right = (Message) object; - return left.getFrom().equals(right.getFrom()) && - left.getTo().equals(right.getTo()) && - left.getText().equals(right.getText()) && - right.getDate() != null && - right.getId() != null; - } - - return false; + public boolean matches(Message right) { + return left.getFrom().equals(right.getFrom()) && + left.getTo().equals(right.getTo()) && + left.getText().equals(right.getText()) && + right.getDate() != null && + right.getId() != null; } } \ No newline at end of file