@Test
public void shouldApplyRelationshipTypeTokenCommandToTheStoreInRecovery() throws Exception
{
final BatchTransactionApplier applier = newApplier( true );
final RelationshipTypeTokenRecord before = new RelationshipTypeTokenRecord( 42 );
final RelationshipTypeTokenRecord after = new RelationshipTypeTokenRecord( 42 );
after.setInUse( true );
after.setNameId( 323 );
final Command.RelationshipTypeTokenCommand command =
new Command.RelationshipTypeTokenCommand( before, after );
final NamedToken token = new NamedToken( "token", 21 );
when( relationshipTypeTokenStore.getToken( (int) command.getKey() ) ).thenReturn( token );
boolean result = apply( applier, command::handle, transactionToApply );
assertFalse( result );
verify( relationshipTypeTokenStore, times( 1 ) ).setHighestPossibleIdInUse( after.getId() );
verify( relationshipTypeTokenStore, times( 1 ) ).updateRecord( after );
verify( cacheAccess, times( 1 ) ).addRelationshipTypeToken( token );
}