}` var nats entity.NatsResult BeforeEach(func() { err := json.Unmarshal([]byte(result), &nats) fmt.Println(err) }) It("Testing Insert OpsMonitor", func() { monitor := entity.Monitor{} monitor.AgentId = nats.Value.AgentId monitor.Index = nats.Value.Index monitor.JobName = nats.Value.Job.Name monitor.JobState = nats.Value.JobState monitor.Value = result errors := monitor.Save() Expect(errors).NotTo(HaveOccurred()) errors = monitor.Delete() Expect(errors).NotTo(HaveOccurred()) }) It("Testing Load OpsMonitor", func() { sq, err := orm.NewOrm().Raw("insert into monitor (updated) values(?)", time.Now()).Exec() Expect(err).NotTo(HaveOccurred()) id, _ := sq.LastInsertId() sq, err = orm.NewOrm().Raw("delete from monitor where id = ?", id).Exec() Expect(err).NotTo(HaveOccurred())