From 293a6978f3d4fdccc22acda970e9911dc6d52d61 Mon Sep 17 00:00:00 2001 From: EthanHealy01 Date: Mon, 6 Jul 2026 19:43:57 +0100 Subject: [PATCH] Fix overview-service tests for requireCurrentUserTeamId() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PolicyOverviewServiceTest and SourceOverviewServiceTest stub the authority and reach team scoping only through the guards' visibleFrom(), which now calls requireCurrentUserTeamId() — re-point their stubs to match. (Full :proprietary and :saas suites green.) --- .../proprietary/policy/overview/PolicyOverviewServiceTest.java | 2 +- .../proprietary/policy/source/SourceOverviewServiceTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/proprietary/src/test/java/stirling/software/proprietary/policy/overview/PolicyOverviewServiceTest.java b/app/proprietary/src/test/java/stirling/software/proprietary/policy/overview/PolicyOverviewServiceTest.java index 221cbc4482..3224ec05b7 100644 --- a/app/proprietary/src/test/java/stirling/software/proprietary/policy/overview/PolicyOverviewServiceTest.java +++ b/app/proprietary/src/test/java/stirling/software/proprietary/policy/overview/PolicyOverviewServiceTest.java @@ -119,7 +119,7 @@ class PolicyOverviewServiceTest { properties.getSecurity().setEnableLogin(true); UserServiceInterface userService = mock(UserServiceInterface.class); PolicyManagementAuthority authority = mock(PolicyManagementAuthority.class); - when(authority.currentUserTeamId()).thenReturn(1L); + when(authority.requireCurrentUserTeamId()).thenReturn(1L); SourceAccessGuard sourceGuard = new SourceAccessGuard(userService, properties, authority); PolicyAccessGuard policyGuard = new PolicyAccessGuard(userService, properties, authority); PolicyOverviewService scoped = diff --git a/app/proprietary/src/test/java/stirling/software/proprietary/policy/source/SourceOverviewServiceTest.java b/app/proprietary/src/test/java/stirling/software/proprietary/policy/source/SourceOverviewServiceTest.java index 275f076db3..0853bf8054 100644 --- a/app/proprietary/src/test/java/stirling/software/proprietary/policy/source/SourceOverviewServiceTest.java +++ b/app/proprietary/src/test/java/stirling/software/proprietary/policy/source/SourceOverviewServiceTest.java @@ -109,7 +109,7 @@ class SourceOverviewServiceTest { properties.getSecurity().setEnableLogin(true); UserServiceInterface userService = mock(UserServiceInterface.class); PolicyManagementAuthority authority = mock(PolicyManagementAuthority.class); - when(authority.currentUserTeamId()).thenReturn(1L); + when(authority.requireCurrentUserTeamId()).thenReturn(1L); SourceAccessGuard sourceGuard = new SourceAccessGuard(userService, properties, authority); PolicyAccessGuard policyGuard = new PolicyAccessGuard(userService, properties, authority); SourceOverviewService scoped =