You need to sign in to do that
Don't have an account?

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 {
@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();
}
}
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();
}
}
Not sure what to do with it.