KEZA’s test environment is not ready, and even when it is, you cannot ask KEZA to make a learner “not eligible” on demand. A mock is a fake KEZA served by the IremboHub mock server. You decide exactly which request gets which answer, so you can test every case in the worksheet, today.
Every mock is one method + URL path with an ordered list of rules.
A request must match the mock’s method (GET, POST…) and URL path. {name} in a path matches any value in that segment.
Each rule has conditions on Header, Query param, Path variable or Body. All conditions in a rule must match (AND).
The first rule whose conditions all match returns its status code and body. So put the most specific rules first.
If no rule matches, the Otherwise response is returned. Make it the partner’s “unauthorized” or “bad request” answer.

New Mock form, filled for a demo
How your teacher does it: in Mocks → New Mock, start from Blank and fill the three sections exactly like this:
1 · Request: POST /victor/keza/v1/auth/login
2 · Responses (the first matching rule wins)
Rule 1 · Valid Irembo credentials
| Match on | Key | Operator | Value | |
|---|---|---|---|---|
| If | Body | username | equals | irembo-integration |
| and | Body | password | equals | Keza@2026 |
Respond with 200 Body type json
{
"status": "SUCCESS",
"data": {
"token": "keza-victor-token-7f3a",
"tokenType": "Bearer",
"expiresIn": 3600
}
}
Otherwise — when no rule above matches
Respond with 401 Body type json
{
"status": "FAILED",
"code": "INVALID_CREDENTIALS",
"message": "Username or password is incorrect."
}
3 · Label
| Field | Value |
|---|---|
| Name | Victor KEZA Login |
| Code | VICTOR_KEZA_LOGIN |
| Service | KEZA |
| Category | victor-course |
| Active | ✔ served by the mock server right away |
data.token — the path from the worksheet.Four rules, one per worksheet case. Every rule checks the bearer token, so an unauthenticated call can only reach Otherwise.
1 · Request: GET /victor/keza/v1/eligibility
2 · Responses (the first matching rule wins)
Rule 1 · Eligible learner
| Match on | Key | Operator | Value | |
|---|---|---|---|---|
| If | Header | Authorization | equals | Bearer keza-victor-token-7f3a |
| and | Query param | nationalId | equals | 1199880012345678 |
| and | Query param | program | equals | DATA_ANALYTICS |
Respond with 200 Body type json
{
"found": true,
"learner": {
"nationalId": "1199880012345678",
"firstName": "Aline",
"lastName": "Mukamana",
"district": "Gasabo"
},
"eligibility": {
"status": "ELIGIBLE",
"programCode": "DATA_ANALYTICS",
"reasonCode": null,
"evaluatedAt": "2026-09-26T08:00:00Z"
}
}
Rule 2 · Not eligible learner
| Match on | Key | Operator | Value | |
|---|---|---|---|---|
| If | Header | Authorization | equals | Bearer keza-victor-token-7f3a |
| and | Query param | nationalId | equals | 1199770098765432 |
Respond with 200 Body type json
{
"found": true,
"learner": {
"nationalId": "1199770098765432",
"firstName": "Eric",
"lastName": "Habimana",
"district": "Huye"
},
"eligibility": {
"status": "NOT_ELIGIBLE",
"programCode": "DATA_ANALYTICS",
"reasonCode": "AGE_LIMIT",
"evaluatedAt": "2026-09-26T08:00:00Z"
}
}
Rule 3 · Authenticated but unknown learner
| Match on | Key | Operator | Value | |
|---|---|---|---|---|
| If | Header | Authorization | equals | Bearer keza-victor-token-7f3a |
Respond with 404 Body type json
{
"found": false,
"code": "LEARNER_NOT_FOUND",
"message": "No learner matches the supplied National ID."
}
Otherwise — when no rule above matches
Respond with 401 Body type json
{
"code": "UNAUTHORIZED",
"message": "Missing or invalid bearer token."
}
3 · Label
| Field | Value |
|---|---|
| Name | Victor KEZA Eligibility |
| Code | VICTOR_KEZA_ELIGIBILITY |
| Service | KEZA |
| Category | victor-course |
| Active | ✔ served by the mock server right away |
NOT_ELIGIBLE, exactly as the KEZA guide says. A business refusal is not an HTTP error here.Press Save with Active switched on. The portal confirms “Success! Mock has been created and applied to the mock server”. The mock is now live at http://mock-service-engine.apps:8000/victor/keza/v1/eligibility — an address only the engine can reach, not your laptop.
Gotcha · Four mock mistakes we see often
- Wrong rule order: a broad rule (token only) above a specific one hides it forever.
- Duplicate signature: two active mocks with the same method, path and conditions are rejected (409). Use your prefix.
- Reserved path: never put a mock under a path containing
/mock/endpoints/; the mock server already uses it.- “Request was not matched” right after saving: the mock server is still reloading. Wait a few seconds and retry before debugging.
You add a rule “Suspended learner” (token + nationalId = 1199660011112222 → 403). Where must it go?
B. First match wins. Rule 3 only checks the token, so it would catch the suspended learner before a rule placed below it.
Your turn · build both mocks with your prefix
- Create
${YOUR_FIRST_NAME}_KEZA_LOGINonPOST /${your_first_name}/keza/v1/auth/loginwith the same two body conditions.- Create
${YOUR_FIRST_NAME}_KEZA_ELIGIBILITYonGET /${your_first_name}/keza/v1/eligibilitywith the four rules in the same order.- Keep them: your endpoint in the next lesson calls them.
Replace the variables before saving (e.g.
ALINE_KEZA_LOGIN,/aline/keza/v1/auth/login).
← 1.3 Read a partner contract: the KEZA worksheet · 1.5 Your first endpoint, with login authentication →