()
| 1055 | } |
| 1056 | |
| 1057 | func (c *CacheTestSuite) TestGetEntityForPool() { |
| 1058 | entity := params.ForgeEntity{ |
| 1059 | ID: "test-entity", |
| 1060 | EntityType: params.ForgeEntityTypeOrganization, |
| 1061 | Name: "test", |
| 1062 | Owner: "test", |
| 1063 | } |
| 1064 | pool := params.Pool{ |
| 1065 | ID: "pool-1", |
| 1066 | OrgID: "test-entity", // Set the org ID to match the entity |
| 1067 | } |
| 1068 | |
| 1069 | SetEntity(entity) |
| 1070 | SetEntityPool(entity.ID, pool) |
| 1071 | |
| 1072 | retrievedEntity, ok := GetEntityForPool(pool.ID) |
| 1073 | c.Require().True(ok) |
| 1074 | c.Require().Equal(entity.ID, retrievedEntity.ID) |
| 1075 | c.Require().Equal(entity.Name, retrievedEntity.Name) |
| 1076 | |
| 1077 | nonExistentEntity, ok := GetEntityForPool("non-existent-pool") |
| 1078 | c.Require().False(ok) |
| 1079 | c.Require().Equal(params.ForgeEntity{}, nonExistentEntity) |
| 1080 | } |
| 1081 | |
| 1082 | func (c *CacheTestSuite) TestGetEntityForScaleSet() { |
| 1083 | entity := params.ForgeEntity{ |
nothing calls this directly
no test coverage detected