github.com/mdaxf/iac@v0.0.0-20240519030858-58a061660378/health/statuscheck_test.go (about) 1 package health 2 3 import ( 4 "reflect" 5 "testing" 6 7 "github.com/gin-gonic/gin" 8 ) 9 10 func TestCheckSystemHealth(t *testing.T) { 11 type args struct { 12 c *gin.Context 13 } 14 r := gin.Default() 15 r.Run(":8080") 16 17 tests := []struct { 18 name string 19 args args 20 want map[string]interface{} 21 wantErr bool 22 }{ 23 // TODO: Add test cases. 24 { 25 name: "TestCheckSystemHealth", 26 args: args{ 27 c: &gin.Context{}, 28 }, 29 want: nil, 30 wantErr: false, 31 }, 32 } 33 for _, tt := range tests { 34 t.Run(tt.name, func(t *testing.T) { 35 got, err := CheckSystemHealth(tt.args.c) 36 if (err != nil) != tt.wantErr { 37 t.Errorf("CheckSystemHealth() error = %v, wantErr %v", err, tt.wantErr) 38 return 39 } 40 if !reflect.DeepEqual(got, tt.want) { 41 t.Errorf("CheckSystemHealth() = %v, want %v", got, tt.want) 42 } 43 }) 44 } 45 }