Skip to content

Commit 7ec7372

Browse files
CopilotAniruddh25
andcommitted
Remove unit test as requested - it duplicates service logic
Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
1 parent 4cebd83 commit 7ec7372

1 file changed

Lines changed: 0 additions & 51 deletions

File tree

src/Service.Tests/Configuration/HealthEndpointTests.cs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -564,57 +564,6 @@ private static RuntimeConfig CreateRuntimeConfig(Dictionary<string, Entity> enti
564564
return runtimeConfig;
565565
}
566566

567-
/// <summary>
568-
/// Verifies that when filtering entities for health checks,
569-
/// stored procedures are excluded while tables are included.
570-
/// This matches the filter logic in HealthCheckHelper.UpdateEntityHealthCheckResultsAsync.
571-
/// </summary>
572-
[TestMethod]
573-
public void HealthChecks_ExcludeStoredProcedures()
574-
{
575-
// Create a config with table and stored procedure entities
576-
RuntimeConfig runtimeConfig = SetupCustomConfigFile(
577-
enableGlobalHealth: true,
578-
enableGlobalRest: true,
579-
enableGlobalGraphql: true,
580-
enabledGlobalMcp: true,
581-
enableDatasourceHealth: true,
582-
enableEntityHealth: true,
583-
enableEntityRest: true,
584-
enableEntityGraphQL: true);
585-
586-
// Add a stored procedure entity to the existing config
587-
Entity storedProcEntity = new(
588-
Source: new("GetData", EntitySourceType.StoredProcedure, null, null),
589-
GraphQL: new("getData", "getDataList"),
590-
Rest: new(Enabled: true),
591-
Permissions: new[] { ConfigurationTests.GetMinimalPermissionConfig(AuthorizationResolver.ROLE_ANONYMOUS) },
592-
Mappings: null,
593-
Relationships: null,
594-
Fields: null);
595-
596-
Dictionary<string, Entity> entitiesWithStoredProc = new(runtimeConfig.Entities.Entities)
597-
{
598-
{ "GetData", storedProcEntity }
599-
};
600-
601-
RuntimeConfig configWithStoredProc = runtimeConfig with
602-
{
603-
Entities = new RuntimeEntities(entitiesWithStoredProc)
604-
};
605-
606-
// Apply the same filter used in HealthCheckHelper.UpdateEntityHealthCheckResultsAsync
607-
List<KeyValuePair<string, Entity>> healthCheckEntities = configWithStoredProc.Entities.Entities
608-
.Where(e => e.Value.IsEntityHealthEnabled && e.Value.Source.Type != EntitySourceType.StoredProcedure)
609-
.ToList();
610-
611-
// Verify stored procedure is excluded and table is included
612-
Assert.IsFalse(healthCheckEntities.Any(e => e.Value.Source.Type == EntitySourceType.StoredProcedure),
613-
"Stored procedures should be excluded from health checks");
614-
Assert.IsTrue(healthCheckEntities.Any(e => e.Value.Source.Type == EntitySourceType.Table),
615-
"Tables should be included in health checks");
616-
}
617-
618567
private static void WriteToCustomConfigFile(RuntimeConfig runtimeConfig)
619568
{
620569
File.WriteAllText(

0 commit comments

Comments
 (0)