diff --git a/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/MockCrlService.scala b/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/MockCrlService.scala index eb02bb549..d98c4602d 100644 --- a/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/MockCrlService.scala +++ b/src/test/scala/org/broadinstitute/dsde/workbench/sam/azure/MockCrlService.scala @@ -22,16 +22,16 @@ import org.mockito.scalatest.MockitoSugar import scala.jdk.CollectionConverters._ object MockCrlService extends MockitoSugar { - val mockMrgName = ManagedResourceGroupName("test-mrg") - val mockSamSpendProfileResource = FullyQualifiedResourceId(SamResourceTypes.spendProfile, ResourceId("test-spend-profile")) - val defaultManagedAppPlan = ManagedAppPlan("mock-plan", "mock-publisher", "mock-auth-user-key") + val mockMrgName: ManagedResourceGroupName = ManagedResourceGroupName("test-mrg") + val mockSamSpendProfileResource: FullyQualifiedResourceId = FullyQualifiedResourceId(SamResourceTypes.spendProfile, ResourceId("test-spend-profile")) + val defaultManagedAppPlan: ManagedAppPlan = ManagedAppPlan("mock-plan", "mock-publisher", "mock-auth-user-key") def apply( user: Option[SamUser] = None, mrgName: ManagedResourceGroupName = mockMrgName, managedAppPlan: ManagedAppPlan = defaultManagedAppPlan, includeBillingProfileTag: Boolean = false - ) = { + ): CrlService = { val mockCrlService = mock[CrlService](RETURNS_SMART_NULLS) val mockRm = mockResourceManager(mrgName, includeBillingProfileTag) val mockAppMgr = mockApplicationManager(user, mrgName, managedAppPlan) @@ -53,6 +53,10 @@ object MockCrlService extends MockitoSugar { .when(mockCrlService.buildApplicationManager(any[TenantId], any[SubscriptionId])) .thenReturn(IO.pure(mockAppMgr)) + lenient() + .when(mockCrlService.getAzureControlPlaneEnabled) + .thenReturn(false) + mockCrlService }