@Test
public void testOnPeerAction() throws Exception
{

    PeerAction peerAction = mock( PeerAction.class );
    doReturn( PeerActionType.REGISTER ).when( peerAction ).getType();
    PeerActionResponse response = environmentManager.onPeerAction( peerAction );
    assertEquals( PeerActionResponse.Ok().getType(), response.getType() );
    //--------------------------------------------
    doReturn( PeerActionType.UNREGISTER ).when( peerAction ).getType();
    doReturn( true ).when( environmentManager ).isPeerInUse( anyString() );
    response = environmentManager.onPeerAction( peerAction );
    assertEquals( PeerActionResponse.Fail().getType(), response.getType() );
}