+ Start a Discussion
Irina Aristova 10Irina Aristova 10 

Advanced Apex Specialist Superbadge Step 5 Error

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 {

    static void SetupTestData(){
     public static void OrderUpdate_UnitTest(){

            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];
            System.assertNotEquals(null, currentProducts);
Miguel MotaMiguel Mota
I have a similar issue with a similar code, I aldo tried a lot of different modifier and nothings works
Irina Aristova 10Irina Aristova 10
I think it has nothing to do with modifies. I debugged the code and saw that when they runs verification, they run anonymous block testDataFactory.verifyQuantityOrdered( originalProduct, updatedProduct, 20 ); method. I see that it failed with the error: Assertion Failed: Expected: 20, Actual: 10. I think they have a bug there. I think they should run: testDataFactory.verifyQuantityOrdered( originalProduct, updatedProduct, 10 );
Not sure what to do with it.