Skip to content

Commit

Permalink
Fix tests where generics interacted badly with varargs
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvest committed May 30, 2017
1 parent 12c69d5 commit ac3ff9d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
Expand Up @@ -40,7 +40,8 @@ public void shouldEncodeAndDecodePullRequestMessage()

// when
channel.writeOutbound( sent );
channel.writeInbound( channel.readOutbound() );
Object message = channel.readOutbound();
channel.writeInbound( message );

// then
StoreCopyFinishedResponse received = channel.readInbound();
Expand Down
Expand Up @@ -39,7 +39,8 @@ public void shouldEncodeAndDecodePullRequestMessage()

// when
channel.writeOutbound( sent );
channel.writeInbound( channel.readOutbound() );
Object message = channel.readOutbound();
channel.writeInbound( message );

// then
TxPullRequest received = channel.readInbound();
Expand Down
Expand Up @@ -32,7 +32,7 @@
import org.neo4j.kernel.impl.transaction.log.entry.LogEntryStart;
import org.neo4j.kernel.impl.transaction.log.entry.OnePhaseCommit;

import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;

Expand All @@ -47,7 +47,8 @@ public void shouldEncodeAndDecodePullResponseMessage()

// when
channel.writeOutbound( sent );
channel.writeInbound( channel.readOutbound() );
Object message = channel.readOutbound();
channel.writeInbound( message );

// then
TxPullResponse received = channel.readInbound();
Expand All @@ -62,7 +63,7 @@ private CommittedTransactionRepresentation newCommittedTransactionRepresentation
new Command.NodeCommand( new NodeRecord( arbitraryRecordId ), new NodeRecord( arbitraryRecordId ) );

PhysicalTransactionRepresentation physicalTransactionRepresentation =
new PhysicalTransactionRepresentation( asList( new LogEntryCommand( command ).getXaCommand() ) );
new PhysicalTransactionRepresentation( singletonList( new LogEntryCommand( command ).getXaCommand() ) );
physicalTransactionRepresentation.setHeader( new byte[]{}, 0, 0, 0, 0, 0, 0 );

LogEntryStart startEntry = new LogEntryStart( 0, 0, 0L, 0L, new byte[]{}, LogPosition.UNSPECIFIED );
Expand Down
Expand Up @@ -106,7 +106,8 @@ public void shouldEncodeAndDecodeVoteRequest()

// when
channel.writeOutbound( request );
channel.writeInbound( channel.readOutbound() );
Object message = channel.readOutbound();
channel.writeInbound( message );

// then
assertEquals( request, channel.readInbound() );
Expand All @@ -121,7 +122,8 @@ public void shouldEncodeAndDecodeVoteResponse()

// when
channel.writeOutbound( response );
channel.writeInbound( channel.readOutbound() );
Object message = channel.readOutbound();
channel.writeInbound( message );

// then
assertEquals( response, channel.readInbound() );
Expand All @@ -138,7 +140,8 @@ public void shouldEncodeAndDecodeAppendEntriesRequest()

// when
channel.writeOutbound( request );
channel.writeInbound( channel.readOutbound() );
Object message = channel.readOutbound();
channel.writeInbound( message );

// then
assertEquals( request, channel.readInbound() );
Expand All @@ -154,7 +157,8 @@ public void shouldEncodeAndDecodeAppendEntriesResponse()

// when
channel.writeOutbound( response );
channel.writeInbound( channel.readOutbound() );
Object message = channel.readOutbound();
channel.writeInbound( message );

// then
assertEquals( response, channel.readInbound() );
Expand All @@ -170,7 +174,8 @@ public void shouldEncodeAndDecodeNewEntryRequest()

// when
channel.writeOutbound( request );
channel.writeInbound( channel.readOutbound() );
Object message = channel.readOutbound();
channel.writeInbound( message );

// then
assertEquals( request, channel.readInbound() );
Expand Down

0 comments on commit ac3ff9d

Please sign in to comment.