RMR handler for A1-EI Query all
[ric-plt/a1.git] / a1-go / pkg / resthooks / resthooks_test.go
index 8c6b59a..8003df7 100644 (file)
@@ -51,13 +51,24 @@ func TestMain(m *testing.M) {
                "a1.policy_type.20000",
                "a1.policy_inst_metadata.1006001.qos",
        }, nil)
-       RMRclient = new(RMRClientMock)
+       rmrSenderInst = new(RmrSenderMock)
        a1.Init()
-       rh = createResthook(sdlInst, RMRclient)
+       rh = createResthook(sdlInst, rmrSenderInst)
        code := m.Run()
        os.Exit(code)
 }
 
+func TestHealth(t *testing.T) {
+       resp := rh.GetA1Health()
+       if resp == true {
+               a1.Logger.Debug("A1 is healthy ")
+               assert.Equal(t, true, resp)
+       } else {
+               a1.Logger.Debug("A1 is unhealthy")
+               assert.Equal(t, false, resp)
+       }
+}
+
 func TestGetAllPolicyType(t *testing.T) {
        resp := rh.GetAllPolicyType()
        assert.Equal(t, 2, len(resp))