Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
jongpie committed Oct 16, 2024
1 parent fe90513 commit 5bfe2fd
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5bfe2fd

Please sign in to comment.