January 2019
Intermediate to advanced
520 pages
14h 32m
English
The next microservice we need to test is a content microservice that allows users to post comments. Create a content.rs file and import the types and utils modules with the necessary types:
mod types;mod utils;use self::utils::{Method, WebApi};use self::types::Comment;
We also will check that the service is available in the content_healthcheck test:
#[test]fn content_healthcheck() { let mut api = WebApi::content(); api.healthcheck("/", "Content Microservice");}
This service is necessary for users to be able to add a new comment, and is loose-coupled (it doesn't need to check that the user exists, because it is protected from non-existent users by router microservices). We will generate a new ID of the user and send a request to post ...
Read now
Unlock full access