Unit tests causing many calls to ccrz.cc_CallContext.getConfigValue can fail with Apex Exception "Too many SOQL queries: 101" if mock Config Setting data is not inserted in the test method.
When ccApiTestData.setupData is called, the data is only valid for a single transaction. If the setupData method is called during a @TestSetup method, the in-memory guard we have in place for fetching configurations gets reset and redundant SOQL will be exectued in the IsTest annotated methods for every call to ccrz.cc_CallContext.getConfigValue.
1. Ensure ccrz.ccApiTestData.setupData is called in each individual @isTest annotated method.
2. If version < 4.13 (4.139), populate ccrz.CCApiTestData.CONFIG_SETTINGS with data. If no specific data is needed, you will still need to include some mock config setting as part of the invocation to ccApiTestData.setupData.Map<String, Object> configSettingMock = new Map<String, Object> {
'safe' => 'default'
};
ccrz.ccApiTestData.setupData(new Map<String,Map<String,Object>> {
ccrz.CCApiTestData.CONFIG_SETTINGS => configSettingMock
};
000395910

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.