From 5bfe2fd60db87770bbaa344793dd069091f92234 Mon Sep 17 00:00:00 2001 From: Jonathan Gillespie Date: Wed, 16 Oct 2024 00:11:50 -0400 Subject: [PATCH] [WIP] --- .../classes/LoggerEngineDataSelector_Tests.cls | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/nebula-logger/core/tests/logger-engine/classes/LoggerEngineDataSelector_Tests.cls b/nebula-logger/core/tests/logger-engine/classes/LoggerEngineDataSelector_Tests.cls index 9f34f6b28..b1984a0de 100644 --- a/nebula-logger/core/tests/logger-engine/classes/LoggerEngineDataSelector_Tests.cls +++ b/nebula-logger/core/tests/logger-engine/classes/LoggerEngineDataSelector_Tests.cls @@ -165,9 +165,20 @@ private class LoggerEngineDataSelector_Tests { LoggerSObjectProxy.Network returnedNetworkProxy = LoggerEngineDataSelector.getInstance().getCachedNetworkProxy(mockNetworkProxy.Id); System.Assert.isNotNull(returnedNetworkProxy); - System.Assert.areEqual(1, System.Limits.getQueries(), 'Query should still be executed, even when using mock records'); + Integer expectedQueryCount; + if (LoggerEngineDataSelector.IS_EXPERIENCE_CLOUD_ENABLED) { + expectedQueryCount = 1; + System.Assert.areEqual( + expectedQueryCount, + System.Limits.getQueries(), + 'Query should still be executed, even when using mock records (and when Network object is available)' + ); + } else { + expectedQueryCount = 0; + System.Assert.areEqual(expectedQueryCount, System.Limits.getQueries(), 'Query should not have been executed (when Network object is not available)'); + } LoggerEngineDataSelector.getInstance().getCachedNetworkProxy(mockNetworkProxy.Id); - System.Assert.areEqual(1, System.Limits.getQueries(), 'Query results should have been cached'); + System.Assert.areEqual(expectedQueryCount, System.Limits.getQueries(), 'Query results should have been cached'); System.Assert.areEqual(mockNetworkProxy.Id, returnedNetworkProxy.Id); System.Assert.areEqual(mockNetworkProxy.Name, returnedNetworkProxy.Name); System.Assert.areEqual(mockNetworkProxy.UrlPathPrefix, returnedNetworkProxy.UrlPathPrefix);