January 2019
Intermediate to advanced
520 pages
14h 32m
English
We will start the users microservice test coverage. Create a users.rs file and import the created modules into it with the necessary types:
mod types;mod utils;use self::types::UserId;use self::utils::{Method, WebApi};
At first, we have to check that the microservice is alive. Add the users_healthcheck method:
#[test]fn users_healthcheck() { let mut api = WebApi::users(); api.healthcheck("/", "Users Microservice");}
It creates an instance of the WebApi struct using the users method that already configures it for interaction with the users microservice. We use the healthcheck method to check the root path of a service that has to return the "Users Microservice" string.
The main purpose of the users microservice is a new users' registration, ...
Read now
Unlock full access