Skip to content
CodeKruPro

Turn customer requirements into executable test cases

20/32

04 · Design cases and verify stored changes

Recommended first: Create a customer and prove it was saved

Your goal: Turn customer requirements into executable test cases

Type each request yourself. This lesson shows the method, URL, headers and body. It does not fill the console.

  1. 1Set up data
  2. 2Send requests
  3. 3Submit answers

Start here: sign in to practise.

Jump to practice

What you will learn

A positive test uses allowed input. A negative test breaks one rule and keeps everything else valid. A written case is not done until you have sent it and kept the response.

Your goals

  • Send one accepted customer and one rejected customer.
  • Keep the two results separate.

Before you start

Read the previous lesson first if you have not already. This course does not require programming.

Practice setup

Click Create workspace. Then log in as the fictional customer named in the steps. Use that practice token, not your CodeKru sign-in. Reset starts this lesson’s data over and invalidates its tokens.

Follow these steps

  1. Read the customer rules: name 1–80 characters after trimming, a unique email, optional age 18–120, and no unknown fields.
  2. Click Create workspace. Send the login request for fictional customer A. Copy the token from the response.
  3. Send a customer create with a valid name, a new fictional email, and that token. Select the successful response.
  4. Send another create that breaks only the name rule, using an empty name and a different email. Select that response.
  5. Copy both statuses and choose what a negative test changes. Submit Answers. Keep the workspace until the score is saved.

Investigate before concluding

First record the actual result for each case. Compare the body, headers and later state with the stated contract. Keep an observation separate from a prediction; use the model answer only after making your own attempt.

What to keep as evidence

  • The accepted and rejected cases are both sent.
  • The negative case breaks only the name.
  • Each status comes from its own selected response.
References for this lesson

Finish this assignment

Select each named response with Use this response. Answer from those responses or the transcript on this page. Click Submit Answers. Your score is the percentage of checks that passed. Core checks are required to finish. Extra evidence checks are labelled. A saved 100/100 means every check passed. Continue opens the next lesson you can submit.

If something goes wrong
  • Change one part of the request at a time.
  • A 401 means the practice login token is missing or expired. Log in again in this workspace.
  • A 409 on create means that fictional email is already used. Choose another email.
Self-review and independent variation
  • The accepted and rejected cases are both sent.
  • The negative case breaks only the name.
  • Each status comes from its own selected response.

Repeat with a different valid name and a new email. The same two rules should still hold.

Automatic checks verify the requests and answers configured for this lesson. The self-review is for your own reasoning. A score is not a certificate.

Open API reference

Practise and save your evidence

The lesson is public. Sign in to send requests and save progress. You will return to this lesson.

Sign in to practiseCreate an account