()
| 1262 | } |
| 1263 | |
| 1264 | func (c *CacheTestSuite) TestGetEntityForInstanceWithScaleSet() { |
| 1265 | entity := params.ForgeEntity{ |
| 1266 | ID: "test-entity", |
| 1267 | EntityType: params.ForgeEntityTypeOrganization, |
| 1268 | Name: "test-org", |
| 1269 | Owner: "test-owner", |
| 1270 | } |
| 1271 | scaleSet := params.ScaleSet{ |
| 1272 | ID: 1, |
| 1273 | OrgID: "test-entity", |
| 1274 | } |
| 1275 | instance := params.Instance{ |
| 1276 | Name: "test-instance", |
| 1277 | ScaleSetID: 1, |
| 1278 | } |
| 1279 | |
| 1280 | SetEntity(entity) |
| 1281 | SetEntityScaleSet(entity.ID, scaleSet) |
| 1282 | SetInstanceCache(instance) |
| 1283 | |
| 1284 | retrievedEntity, ok := GetEntityForInstance("test-instance") |
| 1285 | c.Require().True(ok) |
| 1286 | c.Require().Equal(entity.ID, retrievedEntity.ID) |
| 1287 | c.Require().Equal(entity.Name, retrievedEntity.Name) |
| 1288 | c.Require().Equal(entity.Owner, retrievedEntity.Owner) |
| 1289 | c.Require().Equal(entity.EntityType, retrievedEntity.EntityType) |
| 1290 | } |
| 1291 | |
| 1292 | func (c *CacheTestSuite) TestGetEntityForInstanceWithRepositoryEntity() { |
| 1293 | entity := params.ForgeEntity{ |
nothing calls this directly
no test coverage detected