Skip to content

Commit

Permalink
Fixed broken SessionStateMachineTest
Browse files Browse the repository at this point in the history
Failure was caused by the commit that changed ClientError's effect on
transaction to be ROLLBACK instead of NONE.
  • Loading branch information
lutovich committed Sep 24, 2015
1 parent 6d89f1d commit 437b524
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -91,7 +91,7 @@ public void shouldRollbackOpenTransactionOnRollbackInducingError() throws Throwa
}

@Test
public void shouldLeaveTransactionOpenOnClientErrors() throws Throwable
public void shouldNotLeaveTransactionOpenOnClientErrors() throws Throwable
{
// Given
final TopLevelTransaction tx = mock( TopLevelTransaction.class );
Expand All @@ -106,14 +106,15 @@ public void shouldLeaveTransactionOpenOnClientErrors() throws Throwable
machine.run( "Hello, world!", Collections.EMPTY_MAP, null, Session.Callback.NO_OP );

// Then
assertThat( machine.state(), equalTo( SessionStateMachine.State.RECOVERABLE_ERROR ) );
verifyNoMoreInteractions( tx );
assertThat( machine.state(), equalTo( SessionStateMachine.State.ERROR ) );
verify(tx).failure();
verify(tx).close();

// And when
machine.acknowledgeFailure( null, Session.Callback.NO_OP );

// Then the machine goes back to an idle (no open transaction) state
assertThat(machine.state(), equalTo( SessionStateMachine.State.IN_TRANSACTION ));
assertThat(machine.state(), equalTo( SessionStateMachine.State.IDLE ));
}

@Test
Expand Down

0 comments on commit 437b524

Please sign in to comment.