server: Use named struct initialization in healthcheck test
@@ -52,46 +52,46 @@ func TestHealthHandler(t *testing.T) {
health string
}{
{
- []*pb.AlarmMember{},
- "/health",
- http.StatusOK,
- "true",
+ alarms: []*pb.AlarmMember{},
+ healthCheckURL: "/health",
+ statusCode: http.StatusOK,
+ health: "true",
},
{
- []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}},
- "/health",
- http.StatusServiceUnavailable,
- "false",
+ alarms: []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}},
+ healthCheckURL: "/health",
+ statusCode: http.StatusServiceUnavailable,
+ health: "false",
},
{
- []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}},
- "/health?exclude=NOSPACE",
- http.StatusOK,
- "true",
+ alarms: []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}},
+ healthCheckURL: "/health?exclude=NOSPACE",
+ statusCode: http.StatusOK,
+ health: "true",
},
{
- []*pb.AlarmMember{},
- "/health?exclude=NOSPACE",
- http.StatusOK,
- "true",
+ alarms: []*pb.AlarmMember{},
+ healthCheckURL: "/health?exclude=NOSPACE",
+ statusCode: http.StatusOK,
+ health: "true",
},
{
- []*pb.AlarmMember{{MemberID: uint64(1), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(2), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(3), Alarm: pb.AlarmType_NOSPACE}},
- "/health?exclude=NOSPACE",
- http.StatusOK,
- "true",
+ alarms: []*pb.AlarmMember{{MemberID: uint64(1), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(2), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(3), Alarm: pb.AlarmType_NOSPACE}},
+ healthCheckURL: "/health?exclude=NOSPACE",
+ statusCode: http.StatusOK,
+ health: "true",
},
{
- []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(1), Alarm: pb.AlarmType_CORRUPT}},
- "/health?exclude=NOSPACE",
- http.StatusServiceUnavailable,
- "false",
+ alarms: []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(1), Alarm: pb.AlarmType_CORRUPT}},
+ healthCheckURL: "/health?exclude=NOSPACE",
+ statusCode: http.StatusServiceUnavailable,
+ health: "false",
},
{
- []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(1), Alarm: pb.AlarmType_CORRUPT}},
- "/health?exclude=NOSPACE&exclude=CORRUPT",
- http.StatusOK,
- "true",
+ alarms: []*pb.AlarmMember{{MemberID: uint64(0), Alarm: pb.AlarmType_NOSPACE}, {MemberID: uint64(1), Alarm: pb.AlarmType_CORRUPT}},
+ healthCheckURL: "/health?exclude=NOSPACE&exclude=CORRUPT",
+ statusCode: http.StatusOK,
+ health: "true",
},
}
