diff --git a/pom.xml b/pom.xml index 6b5a2274c3..1398314226 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/ https://repository.jboss.org/nexus/content/repositories/snapshots/ - 4.3.5.Final + 4.6.5.Final 1.1.3 diff --git a/uberfire-extensions/uberfire-metadata/uberfire-metadata-backends/uberfire-metadata-backend-infinispan/src/test/java/org/uberfire/ext/metadata/backend/infinispan/provider/InfinispanPingServiceTest.java b/uberfire-extensions/uberfire-metadata/uberfire-metadata-backends/uberfire-metadata-backend-infinispan/src/test/java/org/uberfire/ext/metadata/backend/infinispan/provider/InfinispanPingServiceTest.java index d1d9d5c258..d59653ac1c 100644 --- a/uberfire-extensions/uberfire-metadata/uberfire-metadata-backends/uberfire-metadata-backend-infinispan/src/test/java/org/uberfire/ext/metadata/backend/infinispan/provider/InfinispanPingServiceTest.java +++ b/uberfire-extensions/uberfire-metadata/uberfire-metadata-backends/uberfire-metadata-backend-infinispan/src/test/java/org/uberfire/ext/metadata/backend/infinispan/provider/InfinispanPingServiceTest.java @@ -25,7 +25,7 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; -import java.util.concurrent.ExecutionException; +import java.util.concurrent.CompletableFuture; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -37,15 +37,19 @@ public class InfinispanPingServiceTest { @Mock(answer = Answers.RETURNS_DEEP_STUBS) - private RemoteCacheImpl remoteCache; + private RemoteCacheImpl remoteCache; + + @Mock + PingResponse pingResponse; @Before - public void setUp() throws ExecutionException, InterruptedException { - when(((PingResponse) remoteCache.ping().toCompletableFuture().get()).isSuccess()).thenReturn(true); + public void setUp() { + when(pingResponse.isSuccess()).thenReturn(true); + when(remoteCache.ping().toCompletableFuture()).thenReturn(CompletableFuture.completedFuture(pingResponse)); } @Test - public void testPingSuccess() throws ExecutionException, InterruptedException { + public void testPingSuccess() { { InfinispanPingService service = spy(new InfinispanPingService(remoteCache)); assertTrue(service.ping()); @@ -53,7 +57,7 @@ public void testPingSuccess() throws ExecutionException, InterruptedException { } { - when(((PingResponse) remoteCache.ping().toCompletableFuture().get()).isSuccess()).thenReturn(false); + when(pingResponse.isSuccess()).thenReturn(false); InfinispanPingService service = spy(new InfinispanPingService(remoteCache)); assertFalse(service.ping()); service.stop();