/***********************************************************************************************************
 * Name         : OwnerUtilsTest
 * Purpose      : Test class for OwnerUtils
 **********************************************************************************************************/
@isTest
private class OwnerUtilsTest {
    /************************************************************************************
     * Method: getOwnerId
     * APEX method tested : OwnerUtils.getOwnerId
     * Description : Verifies that the query is executed only once when the method is called
     *  multiple times
     *************************************************************************************/
    @isTest
    static void getOwnerId() {
        Test.startTest();

        Assert.areEqual(0, Limits.getQueries());
        Id ownerId = OwnerUtils.getOwnerId();
        Assert.isNotNull(ownerId);

        Id ownerId2;
        ownerId2 = OwnerUtils.getOwnerId();
        ownerId2 = OwnerUtils.getOwnerId();
        ownerId2 = OwnerUtils.getOwnerId();
        ownerId2 = OwnerUtils.getOwnerId();

        Assert.areEqual(ownerId, ownerId2);
        Assert.areEqual(1, Limits.getQueries());
        
        Test.stopTest();
    }
}
