-
This unit test will check the Zinc base API:
GET
call to the endpoint/
.- Using assert.Equal will test if the response code is equal to http.StatusOK (i.e 200),that means test is OK.
-
This unit test will check the Zinc version:
GET
call to the endpoint/version
.- Send a request to the server and response would be recorded.
- Using assert.Equal will test if the response code is equal to http.StatusOK (i.e 200),that means test is OK.
- Unmarshal the json recieved in the response body and will check if there is no error using assert.NoError and using assert.True to check if the data has the field "Version".
-
This unit test will check the Zinc Server health:
GET
call to the endpoint/healthz
.- Send a request to the server and response would be recorded.
- Using assert.Equal will test if the response code is equal to http.StatusOK (i.e 200),that means test is OK.
- Unmarshal the json recieved in the response body and will check if there is no error using assert.NoError and using assert.True to check if the data has the field "Status"and using asset.Equal to check if the status is 'ok'.
-
This unit test will check the Zinc UI API:
GET
call to the endpoint/ui
.- Send a request to the server and response would be recorded.
- Using assert.Equal will test if the response code is equal to http.StatusOK (i.e 200),that means test is OK.