Skip to content

Commit

Permalink
[7.67.x-blue] Bump protostream to 4.6.5 (#1426)
Browse files Browse the repository at this point in the history
* Bump protostream to 4.6.5

* Improving test

* Improving test
  • Loading branch information
yesamer authored Sep 20, 2024
1 parent c609ed1 commit 8d0e4b5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<jboss.releases.repo.url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</jboss.releases.repo.url>
<jboss.snapshots.repo.url>https://repository.jboss.org/nexus/content/repositories/snapshots/</jboss.snapshots.repo.url>

<version.org.infinispan.protostream>4.3.5.Final</version.org.infinispan.protostream>
<version.org.infinispan.protostream>4.6.5.Final</version.org.infinispan.protostream>

<!-- Newer version in kie-parent causes ServiceLoader error -->
<version.ch.qos.logback>1.1.3</version.ch.qos.logback>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,23 +37,27 @@
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());
service.stop();
}

{
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();
Expand Down

0 comments on commit 8d0e4b5

Please sign in to comment.