()
| 187 | } |
| 188 | |
| 189 | func (s *OrgTestSuite) TestCreateOrganization() { |
| 190 | // call tested function |
| 191 | org, err := s.Store.CreateOrganization( |
| 192 | s.adminCtx, |
| 193 | s.Fixtures.CreateOrgParams.Name, |
| 194 | s.testCreds, |
| 195 | s.Fixtures.CreateOrgParams.WebhookSecret, |
| 196 | params.PoolBalancerTypeRoundRobin, |
| 197 | false, |
| 198 | ) |
| 199 | |
| 200 | // assertions |
| 201 | s.Require().Nil(err) |
| 202 | storeOrg, err := s.Store.GetOrganizationByID(s.adminCtx, org.ID) |
| 203 | if err != nil { |
| 204 | s.FailNow(fmt.Sprintf("failed to get organization by id: %v", err)) |
| 205 | } |
| 206 | s.Require().Equal(storeOrg.Name, org.Name) |
| 207 | s.Require().Equal(storeOrg.Credentials.Name, org.Credentials.Name) |
| 208 | s.Require().Equal(storeOrg.WebhookSecret, org.WebhookSecret) |
| 209 | |
| 210 | entity, err := org.GetEntity() |
| 211 | s.Require().Nil(err) |
| 212 | s.Require().Equal(entity.EntityType, params.ForgeEntityTypeOrganization) |
| 213 | s.Require().Equal(entity.ID, org.ID) |
| 214 | |
| 215 | forgeType, err := entity.GetForgeType() |
| 216 | s.Require().Nil(err) |
| 217 | s.Require().Equal(forgeType, params.GithubEndpointType) |
| 218 | } |
| 219 | |
| 220 | func (s *OrgTestSuite) TestCreateOrgForGitea() { |
| 221 | // call tested function |
nothing calls this directly
no test coverage detected