• Miguel Mota
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I am getting this error on step 5: Challenge Not yet complete... here's what's wrong:  Ensure that you create the OrderUpdate_UnitTest test method with the proper declaration and proper access modifier, to ensure best practices.
I tried make it public, private, using @isTest, test method, still having same error.

Here is the code:@isTest (seeAllData=false)
private class OrderTests {

    @testSetup
    static void SetupTestData(){
        TestDataFactory.InsertTestData(5);
    }
   
    @isTest
     public static void OrderUpdate_UnitTest(){

       SetupTestData();
        Test.startTest();
            Order order = [Select name,Status, Id from Order limit 1];
            Product2 prod = [Select Quantity_Ordered__c, Name, Id from Product2 limit 1];
        
            order.Status = Constants.ACTIVATED_ORDER_STATUS;
            update order;
        
            Product2 currentProducts = [Select Quantity_Ordered__c, Name, Id from Product2 limit 1];
        
            TestDataFactory.VerifyQuantityOrdered(prod,currentProducts,Constants.DEFAULT_ROWS);
            System.assertNotEquals(null, currentProducts);
        Test.stopTest();
    }
}
Does using this https://trailhead.salesforce.com/projects/workshop-platform-events/steps/platform-event-subscribe count towards the limits for cometd clients? I hope not.
  • April 17, 2018
  • Like
  • 0