@isTest private class FeatureParameterTest { @isTest static void testIncrementMethodsAndFlush() { // Call all increment methods to populate the internal pending map FeatureParameter.incrementOrderCount(); FeatureParameter.incrementOrderItemCount(); FeatureParameter.incrementOrderCount(2); FeatureParameter.incrementOrderItemCount(5); // Execute flush which internally calls @future incrementAsync() Test.startTest(); FeatureParameter.flush(); Test.stopTest(); System.assert(true, 'Flush executed successfully after multiple increments.'); } @isTest static void testIncrementAsyncWithEmptyMap() { // Test when deltas map is empty Map emptyMap = new Map(); Test.startTest(); FeatureParameter.incrementAsync(emptyMap); Test.stopTest(); System.assert(true, 'Handled empty map without error.'); } @isTest static void testIncrementAsyncWithValues() { // Test direct invocation of @future method with data Map deltas = new Map{ 'HIC_ShopifySync__Active_Order_Product_Count' => 10, 'HIC_ShopifySync__Active_Order_Count' => 2 }; Test.startTest(); FeatureParameter.incrementAsync(deltas); Test.stopTest(); System.assert(true, 'incrementAsync executed successfully with data.'); } @isTest static void testFlushWithoutPending() { // Ensure flush works fine even if pending is empty Test.startTest(); FeatureParameter.flush(); Test.stopTest(); System.assert(true, 'Flush with no pending entries executed successfully.'); } }