MCPcopy Create free account
hub / github.com/cloudbase/garm / TestAddOrgEntityEvent

Method TestAddOrgEntityEvent

database/sql/organizations_test.go:951–972  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

949}
950
951func (s *OrgTestSuite) TestAddOrgEntityEvent() {
952 org, err := s.Store.CreateOrganization(
953 s.adminCtx,
954 s.Fixtures.CreateOrgParams.Name,
955 s.testCreds,
956 s.Fixtures.CreateOrgParams.WebhookSecret,
957 params.PoolBalancerTypeRoundRobin,
958 false)
959
960 s.Require().Nil(err)
961 entity, err := org.GetEntity()
962 s.Require().Nil(err)
963 err = s.Store.AddEntityEvent(s.adminCtx, entity, params.StatusEvent, params.EventInfo, "this is a test", 20)
964 s.Require().Nil(err)
965
966 org, err = s.Store.GetOrganizationByID(s.adminCtx, org.ID)
967 s.Require().Nil(err)
968 s.Require().Equal(1, len(org.Events))
969 s.Require().Equal(params.StatusEvent, org.Events[0].EventType)
970 s.Require().Equal(params.EventInfo, org.Events[0].EventLevel)
971 s.Require().Equal("this is a test", org.Events[0].Message)
972}
973
974func (s *OrgTestSuite) TestUpdateOrganizationPoolInvalidOrgID() {
975 entity := params.ForgeEntity{

Callers

nothing calls this directly

Calls 4

CreateOrganizationMethod · 0.65
GetEntityMethod · 0.65
AddEntityEventMethod · 0.65
GetOrganizationByIDMethod · 0.65

Tested by

no test coverage detected