Skip to content

Commit

Permalink
Use constant instead of literal id
Browse files Browse the repository at this point in the history
  • Loading branch information
spacecowboy committed Feb 1, 2016
1 parent 7db0802 commit 60b2703
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -63,10 +63,12 @@

public class TransactionConstraintsIT
{
private static final int SLAVE_ONLY_ID = 1;

@ClassRule
public static final ClusterRule clusterRule = new ClusterRule( TransactionConstraintsIT.class )
.withSharedSetting( HaSettings.pull_interval, "0" )
.withInstanceSetting( HaSettings.slave_only, (serverId) -> serverId == 1 ? "true" : "false" );
.withInstanceSetting( HaSettings.slave_only, (serverId) -> serverId == SLAVE_ONLY_ID ? "true" : "false" );

@Rule
public ExpectedException exception = ExpectedException.none();
Expand Down Expand Up @@ -152,7 +154,7 @@ public void startTxAsSlaveAndFinishItAfterAnotherMasterBeingAvailableShouldNotSu
private HighlyAvailableGraphDatabase getSlaveOnlySlave()
{
HighlyAvailableGraphDatabase db = first( cluster.getAllMembers() );
assertEquals( 1, cluster.getServerId( db ).toIntegerIndex() );
assertEquals( SLAVE_ONLY_ID, cluster.getServerId( db ).toIntegerIndex() );
assertFalse( db.isMaster() );
return db;
}
Expand Down

0 comments on commit 60b2703

Please sign in to comment.