Skip to content

Commit

Permalink
Added azureControlPlane flag to mockCrlService
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronegrant committed May 2, 2024
1 parent e10a094 commit 4b3ca19
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
}

Expand Down

0 comments on commit 4b3ca19

Please sign in to comment.