()
| 384 | } |
| 385 | |
| 386 | func (c *CacheTestSuite) TestReplaceEntityScaleSets() { |
| 387 | entity := params.ForgeEntity{ |
| 388 | ID: "test-entity", |
| 389 | EntityType: params.ForgeEntityTypeOrganization, |
| 390 | Name: "test", |
| 391 | Owner: "test", |
| 392 | } |
| 393 | scaleSet1 := params.ScaleSet{ |
| 394 | ID: 1, |
| 395 | OrgID: "test-entity", |
| 396 | } |
| 397 | scaleSet2 := params.ScaleSet{ |
| 398 | ID: 2, |
| 399 | OrgID: "test-entity", |
| 400 | } |
| 401 | |
| 402 | SetEntity(entity) |
| 403 | ReplaceEntityScaleSets(entity.ID, []params.ScaleSet{scaleSet1, scaleSet2}) |
| 404 | cachedEntity, ok := GetEntity(entity.ID) |
| 405 | c.Require().True(ok) |
| 406 | c.Require().Equal(entity.ID, cachedEntity.ID) |
| 407 | |
| 408 | scaleSets := GetEntityScaleSets(entity.ID) |
| 409 | c.Require().Len(scaleSets, 2) |
| 410 | c.Require().Contains(scaleSets, scaleSet1) |
| 411 | c.Require().Contains(scaleSets, scaleSet2) |
| 412 | } |
| 413 | |
| 414 | func (c *CacheTestSuite) TestDeleteEntity() { |
| 415 | entity := params.ForgeEntity{ |
nothing calls this directly
no test coverage detected