@Test
public void testHandleMessage() throws Exception
{

    Message message = InterceptorStateHelper.getMessage( InterceptorState.SERVER_OUT );
    Exchange exchange = message.getExchange();
    doReturn( message ).when( exchange ).getInMessage();
    doReturn( request ).when( message ).get( AbstractHTTPDestination.HTTP_REQUEST );
    doReturn( Common.DEFAULT_PUBLIC_SECURE_PORT ).when( request ).getLocalPort();
    doReturn( "/rest/v1/peer" ).when( request ).getRequestURI();
    try
    {
        interceptor.handleMessage( message );
    }
    catch ( RuntimeException e )
    {
    }
    verify( interceptor ).handlePeerMessage( anyString(), eq( message ) );
    doReturn( "/rest/v1/env/123/" ).when( request ).getRequestURI();
    try
    {
        interceptor.handleMessage( message );
    }
    catch ( RuntimeException e )
    {
    }
    verify( interceptor ).handleEnvironmentMessage( anyString(), anyString(), eq( message ) );
}