Register
Submit a solution
Status: ‌Cancelled client request

Challenge Overview

This is the 1000 points Hard level problem of Topcoder Skill Builder Challenge: Salesforce Apex. For more challenge contet info Register for the Host Competition before submitting a solution to this problem.

Problem Statement: Web Service and Test Automation

Now all the customers can receive in-time corona cases report in the email, they are feeling warm from DreamHouse. The management teams also like the email service, and they want you to expose it as an HTTP Web Service with REST APIs.

Also, as a good developer, you test your code to ensure that it's bulletproof before deploying it to production. So you need to write unit tests for all the existing code and ensure the coverage is 100%.

Technology Stack

In all the three Skill Builder competitions, you need to develop the app by Visual Studio Code with Salesforce Extension Pack, and you need to create a Salesforce project by the Salesforce CLI. You cannot just write the code in the Developer Console of your Org.

All the code should be deployed to a Scratch Org, and you need to include the link to the Scratch Org, username and password in your submission.

You will need to install the DreamHouse app into your Scratch Org, and all the following development will be based on it.

What do you need to do?

Now all the customers can receive in-time corona cases report in the email, they are feeling warm from DreamHouse. The management teams also like the email service, and they want you to expose it as an HTTP Web Service with REST APIs.

Also, as a good developer, you test your code to ensure that it's bulletproof before deploying it to production. So you need to write unit tests for all the existing code and ensure the coverage is 100%.

1. Build an endpoint for getting the welcome email content

The endpoint should be GET /welcome_email/<Contact Name>
The response should be the in JSON

{
    content: <email content>
}

 

2. Build an endpoint for getting the Corona Cases Email

The endpoint should be GET /corona_cases_email/<Contact Name>
The response should be the in JSON

{
    content: <email content>
}

 

3. Create a Postman collection with Postman environment to test and call these endpoints.

4. Test automation

You need to build unit tests for all cases to ensure the 100% test coverage.
You also need to write callout mock for the two endpoints you built for unit testing.
The unit test should be triggered by Salesforce CLI.

Important things to note

  • You need to write down how to use Salesforce CLI to run the unit test.
  • Configure the language of your Scratch Org to English if it is not.
  • The reviewer will log in to your Scratch Org and check.

Instructions:

  • We have prepared three problems: Easy, Medium, and Hard, which are worth 250, 500, 1000 points respectively. Points are based on the difficulty of the problem.
  • The competitions may or may not be related to each other.
  • The links to the problems/competitions are provided below.
  • Each problem has one single requirement to achieve. We will judge your submission based on the requirement being fulfilled in each problem, so as long as the requirements are met with minimal code quality, you would be rewarded with points for that particular problem.
  • Here is the leaderboard with individual problem score and total score across weeks is available.

Problems

  1. Easy: 250 Points :: Welcome emails
  2. Medium: 500 Points :: Corona Cases Email
  3. Hard: 1000 Points :: Web Service and Test Automation


Final Submission Guidelines

  • The source code of your Salesforce project.

  • The Postman collection/environment files.

  • Deployment guide and validation document. You need to include the link to the Scratch Org, username and password in the document, and mention how to run the tests via Salesforce CLI.

  • A demo video to verify that your submission meets all the requirements (Optional).

ELIGIBLE EVENTS:

2021 Topcoder(R) Open

Review style

Final Review

Community Review Board

Approval

User Sign-Off

ID: 30141545