class RouterDeploymentDefinition {

    protected void setupAccountOwner() {
        if (networkModel.isNetworkSystem(guestNetwork) || guestNetwork.getGuestType() == Network.GuestType.Shared) {
            owner = accountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM);
        }
    }

}

class RouterDeploymentDefinitionTest  {

    @Mock
    protected NetworkVO mockNw;
    protected RouterDeploymentDefinition deployment;

    @Test
    public void testSetupAccountOwnerNotNetworkSystem() {

        // Prepare
        when(mockNetworkModel.isNetworkSystem(mockNw)).thenReturn(false);
        when(mockNw.getGuestType()).thenReturn(Network.GuestType.Shared);
        final Account newAccountOwner = mock(Account.class);
        when(mockAccountMgr.getAccount(Account.ACCOUNT_ID_SYSTEM)).thenReturn(newAccountOwner);
        //Execute
        deployment.setupAccountOwner();
        // Assert
        assertEquals("New account owner not properly set", newAccountOwner, deployment.owner);
    }

}