Skip to content

Commit

Permalink
Added IT to verify statemachine v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhen Li authored and zhenlineo committed Jul 20, 2018
1 parent 6b8a782 commit b7c2916
Show file tree
Hide file tree
Showing 3 changed files with 737 additions and 12 deletions.
Expand Up @@ -24,6 +24,7 @@
import org.neo4j.bolt.runtime.BoltStateMachineState;
import org.neo4j.bolt.runtime.StateMachineContext;
import org.neo4j.bolt.v1.runtime.ConnectedState;
import org.neo4j.bolt.v3.messaging.HelloMessage;
import org.neo4j.values.storable.Values;

/**
Expand All @@ -42,9 +43,13 @@ public class ExtraMetaDataConnectedState extends ConnectedState
@Override
public BoltStateMachineState process( RequestMessage message, StateMachineContext context ) throws BoltConnectionFatality
{
BoltStateMachineState processResult = super.process( message, context );
context.connectionState().onMetadata( ROUTING_TABLE_KEY, Values.stringValue( ROUTING_TABLE_VALUE ) );
context.connectionState().onMetadata( CONNECTION_ID_KEY, Values.stringValue( context.connectionId() ) );
return processResult;
if ( message instanceof HelloMessage )
{
BoltStateMachineState processResult = super.process( message, context );
context.connectionState().onMetadata( ROUTING_TABLE_KEY, Values.stringValue( ROUTING_TABLE_VALUE ) );
context.connectionState().onMetadata( CONNECTION_ID_KEY, Values.stringValue( context.connectionId() ) );
return processResult;
}
return null;
}
}

0 comments on commit b7c2916

Please sign in to comment.