11use std:: process:: exit;
22
3- use reqwest;
43use clap:: Parser ;
4+ use reqwest;
55
6- /// Simple program to greet a person
6+ /// dead simple binary to check http status code(s) returned from health-check
7+ /// endpoint.
78#[ derive( Parser , Debug ) ]
89#[ command( version, about, long_about = None ) ]
910struct Args {
@@ -27,7 +28,7 @@ fn healthcheck(url: String, status_codes: Vec<u16>) -> i32 {
2728 }
2829 return 1 ;
2930 }
30- }
31+ } ;
3132}
3233
3334fn main ( ) {
@@ -44,8 +45,7 @@ mod tests {
4445 fn test_200 ( ) {
4546 let server = MockServer :: start ( ) ;
4647 server. mock ( |when, then| {
47- when. method ( GET )
48- . path ( "/health" ) ;
48+ when. method ( GET ) . path ( "/health" ) ;
4949 then. status ( 200 )
5050 . header ( "content-type" , "text/html" )
5151 . body ( "" ) ;
@@ -57,8 +57,7 @@ mod tests {
5757 fn test_201 ( ) {
5858 let server = MockServer :: start ( ) ;
5959 server. mock ( |when, then| {
60- when. method ( GET )
61- . path ( "/health" ) ;
60+ when. method ( GET ) . path ( "/health" ) ;
6261 then. status ( 201 )
6362 . header ( "content-type" , "text/html" )
6463 . body ( "" ) ;
@@ -70,8 +69,7 @@ mod tests {
7069 fn test_20x ( ) {
7170 let server = MockServer :: start ( ) ;
7271 server. mock ( |when, then| {
73- when. method ( GET )
74- . path ( "/health" ) ;
72+ when. method ( GET ) . path ( "/health" ) ;
7573 then. status ( 299 )
7674 . header ( "content-type" , "text/html" )
7775 . body ( "" ) ;
0 commit comments