Tuesday 24 January 2023

Platform Developer I Certification Maintenance (Winter '23)

First Challenge 

Second Challenge

@isTest

private class DataGenerationTest {

  @testSetup

  static void dataCreation() {

      Account account = TestFactory.getAccount('Muddy Waters Inc.', true);

      Contact contact = TestFactory.getContact(account.Id, 'Muddy', 'Waters', true);

      Opportunity opp = New Opportunity();

      opp.Name = 'Long lost record';

      opp.AccountId = account.Id;

      opp.CloseDate = Date.today().addDays(14);

      opp.StageName = 'Prospecting';

      insert opp;

  }

  @isTest

  static void testBruteForceAccountCreation() {

      List<Account> accts = new List<Account>();

      Test.startTest();

          accts = [SELECT Id FROM Account];

      Test.stopTest();

      Assert.IsTrue(accts.size() > 0, 'Was expecting to find at least one account created on the Test Setup');

  }

  @isTest

  static void testUseTestFactoryToCreateAccountsWithContacts() {

      List<Account> accts;

      List<Contact> contacts;

      TestFactory.generateAccountWithContacts(5);

      Test.startTest();

          accts = [SELECT Id FROM Account];

          contacts = [SELECT Id FROM Contact];

      Test.stopTest();

      Assert.IsTrue(accts.size() > 0, 'Was expecting to find at least one account created');

      Assert.IsTrue(contacts.size() == 6 ,'Was expecting to find 6 contacts');

      Assert.areNotEqual(accts.size(), contacts.size(), 'Was expecting there to be a different number of account and contacts');

  }

  @isTest

  static void testAtTestSetupMethodsRule() {

      List<Opportunity> opps = [SELECT Id, AccountId FROM Opportunity];

      Assert.areEqual(1,opps.size(), 'Expected test to find a single Opp');

  }

}

Sunday 1 January 2023

Copado Certification Maintenance - Fundamentals 1

 Q1. When working with second generation packaging  you can:

    a) Manage package creation, publishing, and distribution from copado UI.

    b) Start using the default rules and code analysis while creating the package version.

    c) Deploy metadata from one salesforce org to another without having to build a new change set.

    d) Integrate critical industry-followed DevSecOps tools.

Answer: Manage package creation, publishing, and distribution from copado UI.

Q2. Which of the following are the improved capabilities of copado CI/CD for second generation?

    a) Leverages source format support.

    b) Provides access to logs and more details executed logic.

    c)Leads to greater stability and authorize further customization.

    d)All of the above.

Answer: All of the above.

Q3. What should you check if you cannot see the Rollback button on your promotion record?

    a) If the rollback feature is enabled in the destination org.

    b) If your profile is assigned the correct license to use the Rollback feature.

    c) If the rollback option is marked as selected in your promotion.

    d) If your user story qualifies to avail of the rollback feature.

AnswerIf the rollback feature is enabled in the destination org.

Q4. What is the user of Review Merge Conflict feature in Copado?

    a) To change the conflict resolution strategy and redeploy your changes.

    b) To review the conflict and stop the promotion until the conflict is resolved.

    c) To let copado know that a particular user story requires an auto resolve.

    d) To review user stories potentially conflicting with your current user story.

Answer: To change the conflict resolution strategy and redeploy your changes.

Q5. If your package is in the beta stage, you can distribute it to non production environments only.

    a) true

    b) false

Answer : False

Q6. Which feature enables you to ensure that when you select a child metadata, the parent element nested metadata is also selected?

    a) Commit, Promote, and Deploy flow of copado CI/CD for salesforce 2nd generation.

    b) Commit, Promote, and Deploy copado classic.

    c) Commit, Promote, and Deploy copado DevOps platform.

Answer : Commit, Promote, and Deploy flow of copado CI/CD for salesforce 2nd generation.

Q7. Which of the following tools can be integrated with copado as quality gate?

    a) Copado Continuous Delivery

    b) Copado Robotic Testing

    c) Copado DevOps Platform

    d) Copado CI/CD for salesforce 2nd Generation

Answer:  Copado Robotic Testing

Q8. From the promotion record how can you auto resolve conflicts for multiple user stories?

    a) Select user stories with conflicts and promote them to the next environment. Copado will detect and the resolve the conflict.

    b) Select the auto resolve conflict button in the promotion record and resolve the conflict automatically.

    c) Determine the overlap between the user stories and select the user stories with conflict only for copado to auto resolve the conflict.

    d) Conflicts can not be resolved automatically for multiple user stories. It can only be resolved manually.

Answer: Determine the overlap between the user stories and select the user stories with conflict only for copado to auto resolve the conflict.

Q9. Which copado solution enables you to deploy metadata changes from salesforce org to another without building a new change set?

    a) Copado Continuous Delivery

    b) Copado Essentials

    c) Copado Robotic Testing

    d) Copado CI/CD

Answer: Copado CI/CD

Q10. Which of the following options has been added to the result record for troubleshooting?

    a) View result option.

    b) Logs option in the result record

    c) Status option the result record.

    d) All of the above.

Answer: All of the above.