@Test
void shouldEncodeHelloMessageWithRoutingContext() throws Exception
{

    Map<String,Value> authToken = new HashMap<>();
    authToken.put( "username", value( "bob" ) );
    authToken.put( "password", value( "secret" ) );
    Map<String,String> routingContext = new HashMap<>();
    routingContext.put( "policy", "eu-fast" );
    encoder.encode( new HelloMessage( "MyDriver", authToken, routingContext ), packer );
    InOrder order = inOrder( packer );
    order.verify( packer ).packStructHeader( 1, HelloMessage.SIGNATURE );
    Map<String,Value> expectedMetadata = new HashMap<>( authToken );
    expectedMetadata.put( "user_agent", value( "MyDriver" ) );
    expectedMetadata.put( "routing", value( routingContext ) );
    order.verify( packer ).pack( expectedMetadata );
}