12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- package main
- import (
- "net/http"
- "testing"
- )
- func TestReadinessCheck(t *testing.T) {
- client := getClient()
- resp, err := client.Get(baseURL + "/health/readiness")
- if err != nil {
- t.Errorf("Error getting response. %v", err)
- return
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- t.Errorf("Wrong statuscode: %d", resp.StatusCode)
- return
- }
- t.Log("Readinesscheck OK.")
- }
- func TestHealthCheck(t *testing.T) {
- client := getClient()
- resp, err := client.Get(baseURL + "/health/health")
- if err != nil {
- t.Errorf("Error getting response. %v", err)
- return
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- t.Errorf("Wrong statuscode: %d", resp.StatusCode)
- return
- }
- t.Log("Healthcheck OK.")
- }
- func TestSSLReadinessCheck(t *testing.T) {
- client := getClient()
- resp, err := client.Get(baseSslURL + "/health/readiness")
- if err != nil {
- t.Errorf("Error getting response. %v", err)
- return
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- t.Errorf("Wrong statuscode: %d", resp.StatusCode)
- return
- }
- t.Log("SSL Readinesscheck OK.")
- }
- func TestSSLHealthCheck(t *testing.T) {
- client := getClient()
- resp, err := client.Get(baseSslURL + "/health/health")
- if err != nil {
- t.Errorf("Error getting response. %v", err)
- return
- }
- defer resp.Body.Close()
- if resp.StatusCode != http.StatusOK {
- t.Errorf("Wrong statuscode: %d", resp.StatusCode)
- return
- }
- t.Log("SSL Healthcheck OK.")
- }
|