diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java index fb3a9dd0bdc4..bd99e6c261f5 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put61Test.java @@ -14,29 +14,22 @@ */ package org.apache.geode.internal.cache.tier.sockets.command; -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Matchers.isA; -import static org.mockito.Mockito.*; - -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.mockito.ArgumentCaptor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import org.apache.geode.CancelCriterion; import org.apache.geode.cache.operations.PutOperationContext; import org.apache.geode.internal.Version; -import org.apache.geode.internal.cache.EntryEventImpl; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.LocalRegion; import org.apache.geode.internal.cache.tier.CachedRegionHelper; import org.apache.geode.internal.cache.tier.sockets.CacheServerStats; -import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; import org.apache.geode.internal.cache.tier.sockets.Message; import org.apache.geode.internal.cache.tier.sockets.Part; import org.apache.geode.internal.cache.tier.sockets.ServerConnection; @@ -44,6 +37,13 @@ import org.apache.geode.internal.security.SecurityService; import org.apache.geode.security.NotAuthorizedException; import org.apache.geode.test.junit.categories.UnitTest; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; @Category(UnitTest.class) public class Put61Test { @@ -107,7 +107,7 @@ public void setUp() throws Exception { when(this.deltaPart.getObject()).thenReturn(true); - when(this.eventPart.getSerializedForm()).thenReturn(this.EVENT); + when(this.eventPart.getSerializedForm()).thenReturn(EVENT); when(this.valuePart.getSerializedForm()).thenReturn(VALUE); when(this.valuePart.isObject()).thenReturn(true); @@ -132,7 +132,7 @@ public void setUp() throws Exception { when(this.serverConnection.getClientVersion()).thenReturn(Version.CURRENT); when(this.localRegion.basicBridgePut(eq(KEY), eq(VALUE), eq(VALUE), eq(true), eq(CALLBACK_ARG), - any(ClientProxyMembershipID.class), eq(true), any(EntryEventImpl.class))).thenReturn(true); + any(), eq(true), any())).thenReturn(true); } @Test diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java index 81f17cbf7207..8d52b8853994 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65Test.java @@ -14,30 +14,23 @@ */ package org.apache.geode.internal.cache.tier.sockets.command; -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Matchers.isA; -import static org.mockito.Mockito.*; - -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.mockito.ArgumentCaptor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import org.apache.geode.CancelCriterion; import org.apache.geode.cache.operations.PutOperationContext; import org.apache.geode.internal.Version; -import org.apache.geode.internal.cache.EntryEventImpl; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.LocalRegion; import org.apache.geode.internal.cache.TXManagerImpl; import org.apache.geode.internal.cache.tier.CachedRegionHelper; import org.apache.geode.internal.cache.tier.sockets.CacheServerStats; -import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; import org.apache.geode.internal.cache.tier.sockets.Message; import org.apache.geode.internal.cache.tier.sockets.Part; import org.apache.geode.internal.cache.tier.sockets.ServerConnection; @@ -45,6 +38,13 @@ import org.apache.geode.internal.security.SecurityService; import org.apache.geode.security.NotAuthorizedException; import org.apache.geode.test.junit.categories.UnitTest; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; @Category(UnitTest.class) public class Put65Test { @@ -122,7 +122,7 @@ public void setUp() throws Exception { when(this.keyPart.getStringOrObject()).thenReturn(KEY); when(this.localRegion.basicBridgePut(eq(KEY), eq(VALUE), eq(null), eq(true), eq(CALLBACK_ARG), - any(ClientProxyMembershipID.class), eq(true), any(EntryEventImpl.class))).thenReturn(true); + any(), eq(true), any())).thenReturn(true); when(this.message.getNumberOfParts()).thenReturn(8); when(this.message.getPart(eq(0))).thenReturn(this.regionNamePart); diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java index 2b22f134ca59..6f894cf8c9af 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/PutTest.java @@ -14,30 +14,24 @@ */ package org.apache.geode.internal.cache.tier.sockets.command; -import static org.assertj.core.api.Assertions.*; +import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Matchers.eq; import static org.mockito.Matchers.isA; -import static org.mockito.Mockito.*; - -import org.apache.geode.internal.cache.EventIDHolder; -import org.junit.Before; -import org.junit.Test; -import org.junit.experimental.categories.Category; -import org.mockito.ArgumentCaptor; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.MockitoAnnotations; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.isNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import org.apache.geode.CancelCriterion; import org.apache.geode.cache.operations.PutOperationContext; import org.apache.geode.internal.Version; -import org.apache.geode.internal.cache.EntryEventImpl; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.LocalRegion; import org.apache.geode.internal.cache.tier.CachedRegionHelper; import org.apache.geode.internal.cache.tier.sockets.CacheServerStats; -import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; import org.apache.geode.internal.cache.tier.sockets.Message; import org.apache.geode.internal.cache.tier.sockets.Part; import org.apache.geode.internal.cache.tier.sockets.ServerConnection; @@ -45,6 +39,13 @@ import org.apache.geode.internal.security.SecurityService; import org.apache.geode.security.NotAuthorizedException; import org.apache.geode.test.junit.categories.UnitTest; +import org.junit.Before; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.mockito.ArgumentCaptor; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; @Category(UnitTest.class) public class PutTest { @@ -129,10 +130,7 @@ public void setUp() throws Exception { when(this.serverConnection.getClientVersion()).thenReturn(Version.CURRENT); when(this.localRegion.basicBridgePut(eq(KEY), eq(VALUE), isNull(), eq(true), eq(CALLBACK_ARG), - isA(ClientProxyMembershipID.class), eq(true), isA(EntryEventImpl.class))).thenReturn(true); - - // here's the actual call made by tests of basicBridgePut... - // region.basicBridgePut(key, value, null, isObject, callbackArg, serverConnection.getProxyID(), true, new EventIDHolder(eventId)); + any(), anyBoolean(), any())).thenReturn(true); } @Test diff --git a/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java b/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java index 2747252508bc..8b2a9b4667c5 100644 --- a/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java +++ b/geode-core/src/test/java/org/apache/geode/internal/statistics/StatisticsImplTest.java @@ -128,14 +128,12 @@ public void invokeSuppliersShouldLogErrorOnlyOnce() { assertEquals(1, stats.invokeSuppliers()); // String message, Object p0, Object p1, Object p2 - verify(logger, times(1)).warn(anyString(), isNull(), anyInt(), - isA(NullPointerException.class)); + verify(logger, times(1)).warn(anyString(), isNull(), anyInt(), isA(NullPointerException.class)); assertEquals(1, stats.invokeSuppliers()); // Make sure the logger isn't invoked again - verify(logger, times(1)).warn(anyString(), isNull(), anyInt(), - isA(NullPointerException.class)); + verify(logger, times(1)).warn(anyString(), isNull(), anyInt(), isA(NullPointerException.class)); } @Test diff --git a/gradle/dependency-versions.properties b/gradle/dependency-versions.properties index f304aac2cd98..183dafcc6b02 100644 --- a/gradle/dependency-versions.properties +++ b/gradle/dependency-versions.properties @@ -66,7 +66,7 @@ junit-quickcheck.version = 0.7 JUnitParams.version = 1.0.6 log4j.version = 2.7 lucene.version = 6.4.1 -mockito-core.version = 2.7.11 +mockito-core.version = 2.8.9 mockrunner.version = 1.1.2 mortbay-jetty-servlet-api.version=3.0.20100224 multithreadedtc.version = 1.01 @@ -76,7 +76,7 @@ mx4j-tools.version = 3.0.1 netty-all.version = 4.1.8.Final open-json.version = 1.8 phantomjsdriver.version=1.3.0 -powermock.version = 1.7.0RC2 +powermock.version = 1.7.0RC4 selenium.version=3.0.1 shiro.version=1.3.2 slf4j-api.version = 1.7.23