@Test
public void testQueueRequest() throws Exception
{

    RequestedHost requestedHost = mock( RequestedHost.class );
    when( requestedHost.getId() ).thenReturn( REQUEST_ID );
    doReturn( TestHelper.PGP_PUBLIC_KEY ).when( requestedHost ).getPublicKey();
    doReturn( "hostname" ).when( requestedHost ).getHostname();
    registrationManager.queueRequest( requestedHost );
    verify( requestDataService ).update( isA( RequestedHostImpl.class ) );
    //-----
    doReturn( null ).when( requestDataService ).find( REQUEST_ID );
    registrationManager.queueRequest( requestedHost );
    verify( registrationManager ).checkManagement( isA( RequestedHost.class ) );
}