()
| 1080 | } |
| 1081 | |
| 1082 | func (c *CacheTestSuite) TestGetEntityForScaleSet() { |
| 1083 | entity := params.ForgeEntity{ |
| 1084 | ID: "test-entity", |
| 1085 | EntityType: params.ForgeEntityTypeOrganization, |
| 1086 | Name: "test", |
| 1087 | Owner: "test", |
| 1088 | } |
| 1089 | scaleSet := params.ScaleSet{ |
| 1090 | ID: 1, |
| 1091 | OrgID: "test-entity", // Set the org ID to match the entity |
| 1092 | } |
| 1093 | |
| 1094 | SetEntity(entity) |
| 1095 | SetEntityScaleSet(entity.ID, scaleSet) |
| 1096 | |
| 1097 | retrievedEntity, ok := GetEntityForScaleSet(scaleSet.ID) |
| 1098 | c.Require().True(ok) |
| 1099 | c.Require().Equal(entity.ID, retrievedEntity.ID) |
| 1100 | c.Require().Equal(entity.Name, retrievedEntity.Name) |
| 1101 | |
| 1102 | nonExistentEntity, ok := GetEntityForScaleSet(999) |
| 1103 | c.Require().False(ok) |
| 1104 | c.Require().Equal(params.ForgeEntity{}, nonExistentEntity) |
| 1105 | } |
| 1106 | |
| 1107 | func (c *CacheTestSuite) TestGetPoolByID() { |
| 1108 | entity := params.ForgeEntity{ |
nothing calls this directly
no test coverage detected