From 4536c6e560b553e40629b2b36d4ef152fc704ca1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 16 Oct 2023 18:54:51 +0000 Subject: [PATCH] CodeGen from PR 26230 in Azure/azure-rest-api-specs Merge 9edc3a9c43bf82cfc2f82a9f162962b76270742e into 4bafbf3ab1532e390ad5757433679e9ebb5cbf38 --- .../CHANGELOG.md | 4 +- .../azure-resourcemanager-billing/README.md | 4 +- .../azure-resourcemanager-billing/SAMPLE.md | 3 +- .../azure-resourcemanager-billing/pom.xml | 9 +- .../billing/BillingManager.java | 8 +- .../AvailableBalancesClientImpl.java | 3 +- .../BillingAccountsClientImpl.java | 3 +- .../BillingManagementClientBuilder.java | 2 +- .../BillingPermissionsClientImpl.java | 9 +- .../BillingRoleAssignmentsClientImpl.java | 24 ++-- .../BillingRoleDefinitionsClientImpl.java | 15 +-- .../BillingSubscriptionsClientImpl.java | 15 +-- .../implementation/CustomersClientImpl.java | 3 +- .../InstructionsClientImpl.java | 9 +- .../InvoiceSectionsClientImpl.java | 9 +- .../implementation/InvoicesClientImpl.java | 12 +- .../implementation/PoliciesClientImpl.java | 12 +- .../implementation/ProductsClientImpl.java | 9 +- .../ReservationsClientImpl.java | 3 +- .../billing/models/AcceptanceMode.java | 12 ++ .../InvoiceSectionsCreateOrUpdateSamples.java | 3 +- .../generated/AgreementInnerTests.java | 27 ----- .../generated/AgreementListResultTests.java | 25 ---- .../generated/AgreementPropertiesTests.java | 30 ----- .../AgreementsGetWithResponseMockTests.java | 64 ---------- ...reementsListByBillingAccountMockTests.java | 65 ---------- .../billing/generated/AmountTests.java | 24 ---- .../generated/AvailableBalanceInnerTests.java | 25 ---- .../AvailableBalancePropertiesTests.java | 24 ---- ...lableBalancesGetWithResponseMockTests.java | 64 ---------- .../billing/generated/AzurePlanTests.java | 25 ---- .../BillingAccountListResultTests.java | 25 ---- .../generated/BillingPeriodInnerTests.java | 25 ---- .../BillingPeriodPropertiesTests.java | 24 ---- ...illingPeriodsGetWithResponseMockTests.java | 64 ---------- .../BillingPeriodsListMockTests.java | 65 ---------- .../BillingPeriodsListResultTests.java | 25 ---- ...missionsListByBillingAccountMockTests.java | 65 ---------- ...missionsListByBillingProfileMockTests.java | 65 ---------- ...ingPermissionsListByCustomerMockTests.java | 65 ---------- ...issionsListByInvoiceSectionsMockTests.java | 67 ----------- .../BillingPermissionsListResultTests.java | 25 ---- ...illingPermissionsPropertiesInnerTests.java | 24 ---- .../generated/BillingProfileInfoTests.java | 36 ------ .../BillingRoleAssignmentInnerTests.java | 42 ------- .../BillingRoleAssignmentListResultTests.java | 25 ---- .../BillingRoleAssignmentPropertiesTests.java | 42 ------- ...ByBillingAccountWithResponseMockTests.java | 74 ------------ ...ByBillingProfileWithResponseMockTests.java | 75 ------------ ...ByInvoiceSectionWithResponseMockTests.java | 75 ------------ ...ByBillingAccountWithResponseMockTests.java | 74 ------------ ...ByBillingProfileWithResponseMockTests.java | 74 ------------ ...ByInvoiceSectionWithResponseMockTests.java | 74 ------------ ...ignmentsListByBillingAccountMockTests.java | 72 ------------ ...ignmentsListByBillingProfileMockTests.java | 72 ------------ ...ignmentsListByInvoiceSectionMockTests.java | 74 ------------ .../BillingRoleDefinitionInnerTests.java | 34 ------ .../BillingRoleDefinitionListResultTests.java | 25 ---- .../BillingRoleDefinitionPropertiesTests.java | 30 ----- ...ByBillingAccountWithResponseMockTests.java | 67 ----------- ...ByBillingProfileWithResponseMockTests.java | 68 ----------- ...ByInvoiceSectionWithResponseMockTests.java | 68 ----------- ...initionsListByBillingAccountMockTests.java | 65 ---------- ...initionsListByBillingProfileMockTests.java | 67 ----------- ...initionsListByInvoiceSectionMockTests.java | 67 ----------- .../BillingSubscriptionInnerTests.java | 37 ------ .../BillingSubscriptionPropertiesTests.java | 37 ------ ...SubscriptionsGetWithResponseMockTests.java | 70 ----------- ...riptionsListByBillingAccountMockTests.java | 73 ------------ ...riptionsListByBillingProfileMockTests.java | 73 ------------ ...gSubscriptionsListByCustomerMockTests.java | 72 ------------ ...riptionsListByInvoiceSectionMockTests.java | 75 ------------ .../BillingSubscriptionsListResultTests.java | 25 ---- .../BillingSubscriptionsMoveMockTests.java | 77 ------------ ...scriptionsUpdateWithResponseMockTests.java | 80 ------------- .../billing/generated/CustomerInnerTests.java | 37 ------ .../generated/CustomerListResultTests.java | 25 ---- .../generated/CustomerPolicyInnerTests.java | 29 ----- .../CustomerPolicyPropertiesTests.java | 26 ---- .../generated/CustomerPropertiesTests.java | 37 ------ .../CustomersGetWithResponseMockTests.java | 70 ----------- ...ustomersListByBillingAccountMockTests.java | 70 ----------- ...ustomersListByBillingProfileMockTests.java | 70 ----------- .../generated/DepartmentPropertiesTests.java | 92 --------------- .../billing/generated/DepartmentTests.java | 39 ------ .../billing/generated/DocumentTests.java | 24 ---- .../generated/DownloadUrlInnerTests.java | 24 ---- .../EnrollmentAccountListResultTests.java | 25 ---- .../EnrollmentAccountPropertiesTests.java | 63 ---------- .../EnrollmentAccountSummaryInnerTests.java | 25 ---- ...rollmentAccountSummaryPropertiesTests.java | 24 ---- .../generated/EnrollmentAccountTests.java | 51 -------- ...lmentAccountsGetWithResponseMockTests.java | 64 ---------- .../EnrollmentAccountsListMockTests.java | 65 ---------- .../generated/EnrollmentPoliciesTests.java | 25 ---- .../IndirectRelationshipInfoTests.java | 36 ------ .../generated/InstructionInnerTests.java | 40 ------- .../generated/InstructionListResultTests.java | 25 ---- .../generated/InstructionPropertiesTests.java | 40 ------- .../InstructionsGetWithResponseMockTests.java | 73 ------------ ...ructionsListByBillingProfileMockTests.java | 74 ------------ .../InstructionsPutWithResponseMockTests.java | 83 ------------- .../billing/generated/InvoiceInnerTests.java | 25 ---- .../generated/InvoiceListResultTests.java | 25 ---- .../generated/InvoicePropertiesTests.java | 25 ---- .../generated/InvoiceSectionInnerTests.java | 49 -------- .../InvoiceSectionListResultTests.java | 25 ---- .../InvoiceSectionPropertiesTests.java | 58 --------- ...nvoiceSectionsCreateOrUpdateMockTests.java | 111 ------------------ ...voiceSectionsGetWithResponseMockTests.java | 72 ------------ ...SectionsListByBillingProfileMockTests.java | 72 ------------ .../InvoiceSectionsOnExpandTests.java | 60 ---------- ...adBillingSubscriptionInvoiceMockTests.java | 65 ---------- .../InvoicesDownloadInvoiceMockTests.java | 63 ---------- ...ltipleBillingProfileInvoicesMockTests.java | 67 ----------- ...eBillingSubscriptionInvoicesMockTests.java | 67 ----------- .../InvoicesGetByIdWithResponseMockTests.java | 64 ---------- ...tionAndInvoiceIdWithResponseMockTests.java | 67 ----------- .../InvoicesGetWithResponseMockTests.java | 67 ----------- ...InvoicesListByBillingAccountMockTests.java | 68 ----------- ...InvoicesListByBillingProfileMockTests.java | 68 ----------- ...cesListByBillingSubscriptionMockTests.java | 65 ---------- .../generated/OperationDisplayTests.java | 25 ---- .../generated/OperationInnerTests.java | 26 ---- .../generated/OperationListResultTests.java | 25 ---- .../generated/OperationsListMockTests.java | 64 ---------- .../billing/generated/ParticipantsTests.java | 24 ---- .../generated/PaymentPropertiesTests.java | 29 ----- ...ByBillingProfileWithResponseMockTests.java | 75 ------------ ...iesGetByCustomerWithResponseMockTests.java | 71 ----------- ...esUpdateCustomerWithResponseMockTests.java | 76 ------------ .../PoliciesUpdateWithResponseMockTests.java | 83 ------------- .../billing/generated/PolicyInnerTests.java | 39 ------ .../generated/PolicyPropertiesTests.java | 39 ------ .../billing/generated/ProductInnerTests.java | 39 ------ .../generated/ProductPropertiesTests.java | 39 ------ .../ProductsGetWithResponseMockTests.java | 75 ------------ ...ProductsListByBillingAccountMockTests.java | 73 ------------ ...ProductsListByBillingProfileMockTests.java | 73 ------------ .../ProductsListByCustomerMockTests.java | 73 ------------ ...ProductsListByInvoiceSectionMockTests.java | 75 ------------ .../generated/ProductsListResultTests.java | 25 ---- .../ProductsMoveWithResponseMockTests.java | 80 ------------- .../ProductsUpdateWithResponseMockTests.java | 83 ------------- .../billing/generated/RebillDetailsTests.java | 25 ---- .../billing/generated/ResellerTests.java | 24 ---- .../generated/ReservationInnerTests.java | 33 ------ .../generated/ReservationPropertyTests.java | 30 ----- .../ReservationPropertyUtilizationTests.java | 28 ----- .../ReservationSkuPropertyTests.java | 21 ---- .../generated/ReservationSummaryTests.java | 25 ---- ...ReservationUtilizationAggregatesTests.java | 24 ---- ...rvationsListByBillingAccountMockTests.java | 76 ------------ ...rvationsListByBillingProfileMockTests.java | 77 ------------ .../ReservationsListResultTests.java | 26 ---- .../generated/TransactionInnerTests.java | 36 ------ .../generated/TransactionListResultTests.java | 26 ---- .../generated/TransactionPropertiesTests.java | 36 ------ .../TransactionsListByInvoiceMockTests.java | 71 ----------- ...ingSubscriptionRequestPropertiesTests.java | 28 ----- ...TransferProductRequestPropertiesTests.java | 28 ----- 161 files changed, 78 insertions(+), 7188 deletions(-) delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java delete mode 100644 sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java diff --git a/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md b/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md index d0e836269e15..52f8f42e6be4 100644 --- a/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md +++ b/sdk/billing/azure-resourcemanager-billing/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2023-10-16) + +- Azure Resource Manager Billing client library for Java. This package contains Microsoft Azure SDK for Billing Management SDK. Billing client provides access to billing resources for Azure subscriptions. Package tag package-2020-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/billing/azure-resourcemanager-billing/README.md b/sdk/billing/azure-resourcemanager-billing/README.md index 61768884439c..81a690955a7b 100644 --- a/sdk/billing/azure-resourcemanager-billing/README.md +++ b/sdk/billing/azure-resourcemanager-billing/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-billing - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -103,3 +103,5 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fbilling%2Fazure-resourcemanager-billing%2FREADME.png) diff --git a/sdk/billing/azure-resourcemanager-billing/SAMPLE.md b/sdk/billing/azure-resourcemanager-billing/SAMPLE.md index 5fb5423696ed..e0346eca3e97 100644 --- a/sdk/billing/azure-resourcemanager-billing/SAMPLE.md +++ b/sdk/billing/azure-resourcemanager-billing/SAMPLE.md @@ -1457,10 +1457,11 @@ public final class InvoiceSectionsCreateOrUpdateSamples { "{invoiceSectionName}", new InvoiceSectionInner() .withDisplayName("invoiceSection1") - .withLabels(mapOf("costCategory", "Support", "pcCode", "A123456")), + .withLabels(mapOf("costCategory", "Support", "pcCode", "fakeTokenPlaceholder")), com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/billing/azure-resourcemanager-billing/pom.xml b/sdk/billing/azure-resourcemanager-billing/pom.xml index 1b82d22ccee6..e8a8327154e9 100644 --- a/sdk/billing/azure-resourcemanager-billing/pom.xml +++ b/sdk/billing/azure-resourcemanager-billing/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java index 759e6a82c9cf..824ed3aa34d3 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/BillingManager.java @@ -283,7 +283,7 @@ public BillingManager authenticate(TokenCredential credential, AzureProfile prof .append("-") .append("com.azure.resourcemanager.billing") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -595,8 +595,10 @@ public Operations operations() { } /** - * @return Wrapped service client BillingManagementClient providing direct access to the underlying auto-generated - * API implementation, based on Azure REST API. + * Gets wrapped service client BillingManagementClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client BillingManagementClient. */ public BillingManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java index 471b34da5840..0fa17f0b4891 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/AvailableBalancesClientImpl.java @@ -53,8 +53,7 @@ public final class AvailableBalancesClientImpl implements AvailableBalancesClien public interface AvailableBalancesService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/availableBalance/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java index 11d57989b527..e0d3ec8aa7e1 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingAccountsClientImpl.java @@ -104,8 +104,7 @@ Mono>> update( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}" - + "/listInvoiceSectionsWithCreateSubscriptionPermission") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java index 884d4f2877fd..0c79bc7bd210 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingManagementClientBuilder.java @@ -137,7 +137,7 @@ public BillingManagementClientImpl buildClient() { localSerializerAdapter, localDefaultPollInterval, localEnvironment, - subscriptionId, + this.subscriptionId, localEndpoint); return client; } diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java index 73f902d8b417..dea6c10149aa 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingPermissionsClientImpl.java @@ -58,8 +58,7 @@ public final class BillingPermissionsClientImpl implements BillingPermissionsCli public interface BillingPermissionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}" - + "/billingPermissions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingPermissions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByCustomer( @@ -83,8 +82,7 @@ Mono> listByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingPermissions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByInvoiceSections( @@ -98,8 +96,7 @@ Mono> listByInvoiceSections( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingPermissions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java index f7fda1ead39c..f7312dfe35a4 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleAssignmentsClientImpl.java @@ -60,8 +60,7 @@ public final class BillingRoleAssignmentsClientImpl implements BillingRoleAssign public interface BillingRoleAssignmentsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments" - + "/{billingRoleAssignmentName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByBillingAccount( @@ -74,8 +73,7 @@ Mono> getByBillingAccount( @Headers({"Content-Type: application/json"}) @Delete( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments" - + "/{billingRoleAssignmentName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> deleteByBillingAccount( @@ -88,8 +86,7 @@ Mono> deleteByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByInvoiceSection( @@ -104,8 +101,7 @@ Mono> getByInvoiceSection( @Headers({"Content-Type: application/json"}) @Delete( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> deleteByInvoiceSection( @@ -120,8 +116,7 @@ Mono> deleteByInvoiceSection( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleAssignments/{billingRoleAssignmentName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByBillingProfile( @@ -135,8 +130,7 @@ Mono> getByBillingProfile( @Headers({"Content-Type: application/json"}) @Delete( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleAssignments/{billingRoleAssignmentName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> deleteByBillingProfile( @@ -161,8 +155,7 @@ Mono> listByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleAssignments") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByInvoiceSection( @@ -176,8 +169,7 @@ Mono> listByInvoiceSection( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleAssignments") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java index 710bb76bafa2..fcf9960dd472 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingRoleDefinitionsClientImpl.java @@ -59,8 +59,7 @@ public final class BillingRoleDefinitionsClientImpl implements BillingRoleDefini public interface BillingRoleDefinitionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions" - + "/{billingRoleDefinitionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByBillingAccount( @@ -73,8 +72,7 @@ Mono> getByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByInvoiceSection( @@ -89,8 +87,7 @@ Mono> getByInvoiceSection( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleDefinitions/{billingRoleDefinitionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByBillingProfile( @@ -115,8 +112,7 @@ Mono> listByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingRoleDefinitions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByInvoiceSection( @@ -130,8 +126,7 @@ Mono> listByInvoiceSection( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingRoleDefinitions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java index a4f90ebb8fd1..445bb551dd65 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/BillingSubscriptionsClientImpl.java @@ -69,8 +69,7 @@ public final class BillingSubscriptionsClientImpl implements BillingSubscription public interface BillingSubscriptionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}" - + "/billingSubscriptions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByCustomer( @@ -94,8 +93,7 @@ Mono> listByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/billingSubscriptions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -108,8 +106,7 @@ Mono> listByBillingProfile( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/billingSubscriptions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByInvoiceSection( @@ -149,8 +146,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}" - + "/move") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/move") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> move( @@ -164,8 +160,7 @@ Mono>> move( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}" - + "/validateMoveEligibility") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/validateMoveEligibility") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> validateMove( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java index 438edd7d782a..03f34b66de85 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/CustomersClientImpl.java @@ -58,8 +58,7 @@ public final class CustomersClientImpl implements CustomersClient { public interface CustomersService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/customers") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java index 5f094a916875..dc26c23550f5 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InstructionsClientImpl.java @@ -60,8 +60,7 @@ public final class InstructionsClientImpl implements InstructionsClient { public interface InstructionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/instructions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -74,8 +73,7 @@ Mono> listByBillingProfile( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/instructions/{instructionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -89,8 +87,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/instructions/{instructionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> put( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java index 52223c1c5260..c32e726f734f 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoiceSectionsClientImpl.java @@ -65,8 +65,7 @@ public final class InvoiceSectionsClientImpl implements InvoiceSectionsClient { public interface InvoiceSectionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -79,8 +78,7 @@ Mono> listByBillingProfile( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -94,8 +92,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java index a3744a74d328..c58f1d858700 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/InvoicesClientImpl.java @@ -79,8 +79,7 @@ Mono> listByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoices") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -156,8 +155,7 @@ Mono> listByBillingSubscription( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices" - + "/{invoiceName}") + "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getBySubscriptionAndInvoiceId( @@ -170,8 +168,7 @@ Mono> getBySubscriptionAndInvoiceId( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices" - + "/{invoiceName}/download") + "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> downloadBillingSubscriptionInvoice( @@ -185,8 +182,7 @@ Mono>> downloadBillingSubscriptionInvoice( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}" - + "/downloadDocuments") + "/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/downloadDocuments") @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> downloadMultipleBillingSubscriptionInvoices( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java index b4434dc1de79..2c50df0a25bf 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/PoliciesClientImpl.java @@ -55,8 +55,7 @@ public final class PoliciesClientImpl implements PoliciesClient { public interface PoliciesService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/policies/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByBillingProfile( @@ -69,8 +68,7 @@ Mono> getByBillingProfile( @Headers({"Content-Type: application/json"}) @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/policies/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update( @@ -84,8 +82,7 @@ Mono> update( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies" - + "/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByCustomer( @@ -98,8 +95,7 @@ Mono> getByCustomer( @Headers({"Content-Type: application/json"}) @Put( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies" - + "/default") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> updateCustomer( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java index 6dbdf32dc329..3341567490f1 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ProductsClientImpl.java @@ -87,8 +87,7 @@ Mono> listByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/products") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/products") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -102,8 +101,7 @@ Mono> listByBillingProfile( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/invoiceSections/{invoiceSectionName}/products") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByInvoiceSection( @@ -156,8 +154,7 @@ Mono move( @Headers({"Content-Type: application/json"}) @Post( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}" - + "/validateMoveEligibility") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/validateMoveEligibility") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> validateMove( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java index 63a7793a8cf7..af42f97e4b06 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/implementation/ReservationsClientImpl.java @@ -73,8 +73,7 @@ Mono> listByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}" - + "/reservations") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/reservations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( diff --git a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AcceptanceMode.java b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AcceptanceMode.java index 68440555fd9b..f8e1710e1341 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AcceptanceMode.java +++ b/sdk/billing/azure-resourcemanager-billing/src/main/java/com/azure/resourcemanager/billing/models/AcceptanceMode.java @@ -10,6 +10,9 @@ /** The mode of acceptance for an agreement. */ public final class AcceptanceMode extends ExpandableStringEnum { + /** Static value Other for AcceptanceMode. */ + public static final AcceptanceMode OTHER = fromString("Other"); + /** Static value ClickToAccept for AcceptanceMode. */ public static final AcceptanceMode CLICK_TO_ACCEPT = fromString("ClickToAccept"); @@ -19,6 +22,15 @@ public final class AcceptanceMode extends ExpandableStringEnum { /** Static value ESignOffline for AcceptanceMode. */ public static final AcceptanceMode ESIGN_OFFLINE = fromString("ESignOffline"); + /** Static value PhysicalSign for AcceptanceMode. */ + public static final AcceptanceMode PHYSICAL_SIGN = fromString("PhysicalSign"); + + /** Static value Offline for AcceptanceMode. */ + public static final AcceptanceMode OFFLINE = fromString("Offline"); + + /** Static value Implicit for AcceptanceMode. */ + public static final AcceptanceMode IMPLICIT = fromString("Implicit"); + /** * Creates a new instance of AcceptanceMode value. * diff --git a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java index 854b6b370fd8..e3ab442c7a03 100644 --- a/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java +++ b/sdk/billing/azure-resourcemanager-billing/src/samples/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateSamples.java @@ -27,10 +27,11 @@ public static void putInvoiceSection(com.azure.resourcemanager.billing.BillingMa "{invoiceSectionName}", new InvoiceSectionInner() .withDisplayName("invoiceSection1") - .withLabels(mapOf("costCategory", "Support", "pcCode", "A123456")), + .withLabels(mapOf("costCategory", "Support", "pcCode", "fakeTokenPlaceholder")), com.azure.core.util.Context.NONE); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java deleted file mode 100644 index 1f7b74ba75ee..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AgreementInner; -import com.azure.resourcemanager.billing.models.Participants; -import java.util.Arrays; - -public final class AgreementInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgreementInner model = - BinaryData - .fromString( - "{\"properties\":{\"agreementLink\":\"goo\",\"category\":\"Other\",\"acceptanceMode\":\"ClickToAccept\",\"billingProfileInfo\":{\"billingProfileId\":\"bvleorfmluiqtqzf\",\"billingProfileDisplayName\":\"yvnqqybaryeuay\",\"indirectRelationshipOrganizationName\":\"qabqgzslesjcb\"},\"effectiveDate\":\"2021-02-16T20:00:10Z\",\"expirationDate\":\"2021-04-10T08:53:01Z\",\"participants\":[{\"status\":\"w\",\"statusDate\":\"2021-08-27T00:56:15Z\",\"email\":\"bquwrbehw\"}],\"status\":\"o\"},\"id\":\"buffkmrqemvvhm\",\"name\":\"tdrjfutacoebj\",\"type\":\"ewzcjznmwcp\"}") - .toObject(AgreementInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgreementInner model = new AgreementInner().withParticipants(Arrays.asList(new Participants())); - model = BinaryData.fromObject(model).toObject(AgreementInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java deleted file mode 100644 index 8a6c59713bfb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.AgreementListResult; - -public final class AgreementListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgreementListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"agreementLink\":\"ibthostgktstvd\",\"category\":\"MicrosoftCustomerAgreement\",\"acceptanceMode\":\"ESignEmbedded\",\"effectiveDate\":\"2021-03-03T03:15:27Z\",\"expirationDate\":\"2021-06-23T00:26:33Z\",\"participants\":[],\"status\":\"zlhp\"},\"id\":\"odqkdlwwqfb\",\"name\":\"mlkxtrqjfs\",\"type\":\"lmbtxhwgfwsrt\"}],\"nextLink\":\"coezbrhubskh\"}") - .toObject(AgreementListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgreementListResult model = new AgreementListResult(); - model = BinaryData.fromObject(model).toObject(AgreementListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java deleted file mode 100644 index 95388707ed2c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AgreementProperties; -import com.azure.resourcemanager.billing.models.Participants; -import java.util.Arrays; - -public final class AgreementPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AgreementProperties model = - BinaryData - .fromString( - "{\"agreementLink\":\"uaadraufactkahzo\",\"category\":\"MicrosoftCustomerAgreement\",\"acceptanceMode\":\"ESignOffline\",\"billingProfileInfo\":{\"billingProfileId\":\"xxpshneeku\",\"billingProfileDisplayName\":\"gs\",\"indirectRelationshipOrganizationName\":\"ubkwdle\"},\"effectiveDate\":\"2021-04-28T05:58:57Z\",\"expirationDate\":\"2021-04-26T16:34:12Z\",\"participants\":[{\"status\":\"bazpjuohmi\",\"statusDate\":\"2021-09-21T23:44:56Z\",\"email\":\"norwmduvwpklvx\"},{\"status\":\"ygdxpgpqchis\",\"statusDate\":\"2021-05-26T11:43:30Z\",\"email\":\"nb\"},{\"status\":\"rxgibbd\",\"statusDate\":\"2021-01-14T17:21:41Z\",\"email\":\"nfo\"},{\"status\":\"uors\",\"statusDate\":\"2021-10-18T05:02:18Z\",\"email\":\"wbqpl\"}],\"status\":\"vnuuepzl\"}") - .toObject(AgreementProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AgreementProperties model = - new AgreementProperties() - .withParticipants( - Arrays.asList(new Participants(), new Participants(), new Participants(), new Participants())); - model = BinaryData.fromObject(model).toObject(AgreementProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java deleted file mode 100644 index 624664dfc592..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Agreement; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AgreementsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"agreementLink\":\"eaoqaqbzgyhf\",\"category\":\"Other\",\"acceptanceMode\":\"ClickToAccept\",\"billingProfileInfo\":{\"billingProfileId\":\"wbqamteuliy\",\"billingProfileDisplayName\":\"pkcvmwf\",\"indirectRelationshipOrganizationName\":\"xxe\"},\"effectiveDate\":\"2021-08-01T10:31:28Z\",\"expirationDate\":\"2021-11-27T08:01:10Z\",\"participants\":[],\"status\":\"c\"},\"id\":\"miciij\",\"name\":\"pkzfbojxj\",\"type\":\"cs\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Agreement response = - manager.agreements().getWithResponse("zjd", "r", "jb", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java deleted file mode 100644 index 6597fe543582..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AgreementsListByBillingAccountMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Agreement; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AgreementsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"agreementLink\":\"gttmvmmagoaqyl\",\"category\":\"MicrosoftCustomerAgreement\",\"acceptanceMode\":\"ClickToAccept\",\"billingProfileInfo\":{\"billingProfileId\":\"azjcgmxitpfin\",\"billingProfileDisplayName\":\"pdltkrlg\",\"indirectRelationshipOrganizationName\":\"tbdrvcqgue\"},\"effectiveDate\":\"2021-05-18T02:25:41Z\",\"expirationDate\":\"2021-08-13T12:33:46Z\",\"participants\":[],\"status\":\"qdurelyujlfyoum\"},\"id\":\"ckyeclcdigpta\",\"name\":\"brzmqxucycijoclx\",\"type\":\"utgjcyz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.agreements().listByBillingAccount("aderzmw", "t", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java deleted file mode 100644 index e5b9eef51ad9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AmountTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Amount; -import org.junit.jupiter.api.Assertions; - -public final class AmountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Amount model = BinaryData.fromString("{\"currency\":\"rbpizc\",\"value\":87.63677}").toObject(Amount.class); - Assertions.assertEquals(87.63677F, model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Amount model = new Amount().withValue(87.63677F); - model = BinaryData.fromObject(model).toObject(Amount.class); - Assertions.assertEquals(87.63677F, model.value()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java deleted file mode 100644 index 7484a233d57c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalanceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner; - -public final class AvailableBalanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableBalanceInner model = - BinaryData - .fromString( - "{\"properties\":{\"amount\":{\"currency\":\"kouknvudwtiu\",\"value\":51.070255}},\"id\":\"dng\",\"name\":\"pocipazyxoegu\",\"type\":\"g\"}") - .toObject(AvailableBalanceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableBalanceInner model = new AvailableBalanceInner(); - model = BinaryData.fromObject(model).toObject(AvailableBalanceInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java deleted file mode 100644 index fdffcb712d86..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancePropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceProperties; - -public final class AvailableBalancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AvailableBalanceProperties model = - BinaryData - .fromString("{\"amount\":{\"currency\":\"iucgygevqzn\",\"value\":13.069307}}") - .toObject(AvailableBalanceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AvailableBalanceProperties model = new AvailableBalanceProperties(); - model = BinaryData.fromObject(model).toObject(AvailableBalanceProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java deleted file mode 100644 index cd3761316bd0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AvailableBalancesGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AvailableBalance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AvailableBalancesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"amount\":{\"currency\":\"x\",\"value\":73.497665}},\"id\":\"lc\",\"name\":\"xwmdboxd\",\"type\":\"gsftufqobrjlnacg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AvailableBalance response = - manager.availableBalances().getWithResponse("es", "kdlpa", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java deleted file mode 100644 index 1a38d2eb37a2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/AzurePlanTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.AzurePlan; -import org.junit.jupiter.api.Assertions; - -public final class AzurePlanTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzurePlan model = - BinaryData.fromString("{\"skuId\":\"hocdgeab\",\"skuDescription\":\"phut\"}").toObject(AzurePlan.class); - Assertions.assertEquals("hocdgeab", model.skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzurePlan model = new AzurePlan().withSkuId("hocdgeab"); - model = BinaryData.fromObject(model).toObject(AzurePlan.class); - Assertions.assertEquals("hocdgeab", model.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java deleted file mode 100644 index a0963b249e06..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingAccountListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingAccountListResult; - -public final class BillingAccountListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingAccountListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"uv\",\"agreementType\":\"MicrosoftPartnerAgreement\",\"accountType\":\"Individual\",\"accountStatus\":\"Extended\",\"departments\":[],\"enrollmentAccounts\":[],\"hasReadAccess\":true,\"notificationEmailAddress\":\"pbsphrupidgs\"},\"id\":\"bb\",\"name\":\"jhphoyc\",\"type\":\"sx\"},{\"properties\":{\"displayName\":\"hdxbmtqio\",\"agreementType\":\"EnterpriseAgreement\",\"accountType\":\"Individual\",\"accountStatus\":\"Expired\",\"departments\":[],\"enrollmentAccounts\":[],\"hasReadAccess\":false,\"notificationEmailAddress\":\"izhwlrxy\"},\"id\":\"qsoqijgkd\",\"name\":\"bpazlobcufpdzn\",\"type\":\"btcqq\"},{\"properties\":{\"displayName\":\"glhqg\",\"agreementType\":\"MicrosoftOnlineServicesProgram\",\"accountType\":\"Individual\",\"accountStatus\":\"Active\",\"departments\":[],\"enrollmentAccounts\":[],\"hasReadAccess\":false,\"notificationEmailAddress\":\"aagdfmg\"},\"id\":\"zlhjxrifkwmrvkt\",\"name\":\"izntocipao\",\"type\":\"ajpsquc\"}],\"nextLink\":\"o\"}") - .toObject(BillingAccountListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingAccountListResult model = new BillingAccountListResult(); - model = BinaryData.fromObject(model).toObject(BillingAccountListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java deleted file mode 100644 index 6ec0e98a459d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodInner; - -public final class BillingPeriodInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPeriodInner model = - BinaryData - .fromString( - "{\"properties\":{\"invoiceIds\":[\"ctxmwoteyowcluq\",\"vekqvgqo\",\"wifzmp\",\"wyivqikf\"]},\"id\":\"cvhrfsp\",\"name\":\"uagrttikteusqc\",\"type\":\"kvyklxubyjaffmm\"}") - .toObject(BillingPeriodInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPeriodInner model = new BillingPeriodInner(); - model = BinaryData.fromObject(model).toObject(BillingPeriodInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java deleted file mode 100644 index 25cc3a72d9fd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPeriodProperties; - -public final class BillingPeriodPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPeriodProperties model = - BinaryData - .fromString("{\"invoiceIds\":[\"cuubgq\",\"brta\",\"metttwgd\"]}") - .toObject(BillingPeriodProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPeriodProperties model = new BillingPeriodProperties(); - model = BinaryData.fromObject(model).toObject(BillingPeriodProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java deleted file mode 100644 index f0f0d4b7a996..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPeriodsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"invoiceIds\":[\"inic\",\"teajohiyg\"]},\"id\":\"pnbonhpcz\",\"name\":\"kmktpvwxqcseh\",\"type\":\"hkhufm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingPeriod response = - manager.billingPeriods().getWithResponse("wugiqjti", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java deleted file mode 100644 index b17ab4dbac9e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPeriod; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPeriodsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"invoiceIds\":[\"qlnfw\",\"y\",\"mvqdbpbhfckdvez\",\"rcssbzhddubbnq\"]},\"id\":\"b\",\"name\":\"h\",\"type\":\"alehpav\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPeriods().list("jreuykbbmn", "aglt", 608268235, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java deleted file mode 100644 index 59c70858829a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPeriodsListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingPeriodsListResult; - -public final class BillingPeriodsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPeriodsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"invoiceIds\":[]},\"id\":\"lcwkhihihlhz\",\"name\":\"sqtzbsrg\",\"type\":\"o\"}],\"nextLink\":\"jhf\"}") - .toObject(BillingPeriodsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPeriodsListResult model = new BillingPeriodsListResult(); - model = BinaryData.fromObject(model).toObject(BillingPeriodsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java deleted file mode 100644 index 9b943318962a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingAccountMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"juj\",\"ickpz\",\"cpopmxel\",\"wcltyjede\"],\"notActions\":[\"lfmk\",\"scazuawxtzxpu\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPermissions().listByBillingAccount("zhraglkafh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java deleted file mode 100644 index 9710e57cb536..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"upeujlzqnhcvsq\"],\"notActions\":[\"zoibgsxg\",\"xfyqonmpqoxwdo\",\"dbxiqx\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPermissions().listByBillingProfile("zcbmqqvxmvwf", "tayx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java deleted file mode 100644 index 78f4e5c013a1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByCustomerMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByCustomerMockTests { - @Test - public void testListByCustomer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"zkzobgopxlhslnel\",\"ieixynllxe\"],\"notActions\":[\"rojphslhcawjutif\",\"wfmvigorqjbt\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingPermissions().listByCustomer("dsxwaab", "mifrygznmma", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java deleted file mode 100644 index 4b5879673099..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListByInvoiceSectionsMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingPermissionsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingPermissionsListByInvoiceSectionsMockTests { - @Test - public void testListByInvoiceSections() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"actions\":[\"wywa\",\"oi\"],\"notActions\":[\"smjblmljhlnym\",\"otqyry\"]}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingPermissions() - .listByInvoiceSections("mwabzxrvxc", "s", "sphaivmxyasflvg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java deleted file mode 100644 index fcdd9386574f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingPermissionsListResult; - -public final class BillingPermissionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPermissionsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"actions\":[\"kphywpnvjto\",\"nermcl\",\"plpho\",\"uscrpabgyepsb\"],\"notActions\":[\"zq\",\"gxywpmue\",\"fjz\",\"fqkquj\"]}],\"nextLink\":\"suyonobglaocq\"}") - .toObject(BillingPermissionsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPermissionsListResult model = new BillingPermissionsListResult(); - model = BinaryData.fromObject(model).toObject(BillingPermissionsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java deleted file mode 100644 index 21fc66c4098c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingPermissionsPropertiesInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; - -public final class BillingPermissionsPropertiesInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingPermissionsPropertiesInner model = - BinaryData - .fromString("{\"actions\":[\"cmgyud\"],\"notActions\":[\"lmoyrx\",\"wfudwpzntxhdzhl\"]}") - .toObject(BillingPermissionsPropertiesInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingPermissionsPropertiesInner model = new BillingPermissionsPropertiesInner(); - model = BinaryData.fromObject(model).toObject(BillingPermissionsPropertiesInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java deleted file mode 100644 index 74af700e4d95..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingProfileInfoTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingProfileInfo; -import org.junit.jupiter.api.Assertions; - -public final class BillingProfileInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingProfileInfo model = - BinaryData - .fromString( - "{\"billingProfileId\":\"hw\",\"billingProfileDisplayName\":\"oldweyuqdu\",\"indirectRelationshipOrganizationName\":\"mnnrwr\"}") - .toObject(BillingProfileInfo.class); - Assertions.assertEquals("hw", model.billingProfileId()); - Assertions.assertEquals("oldweyuqdu", model.billingProfileDisplayName()); - Assertions.assertEquals("mnnrwr", model.indirectRelationshipOrganizationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingProfileInfo model = - new BillingProfileInfo() - .withBillingProfileId("hw") - .withBillingProfileDisplayName("oldweyuqdu") - .withIndirectRelationshipOrganizationName("mnnrwr"); - model = BinaryData.fromObject(model).toObject(BillingProfileInfo.class); - Assertions.assertEquals("hw", model.billingProfileId()); - Assertions.assertEquals("oldweyuqdu", model.billingProfileDisplayName()); - Assertions.assertEquals("mnnrwr", model.indirectRelationshipOrganizationName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java deleted file mode 100644 index fded7fada716..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentInner; -import org.junit.jupiter.api.Assertions; - -public final class BillingRoleAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleAssignmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"createdOn\":\"ithtywu\",\"createdByPrincipalTenantId\":\"cbihwqk\",\"createdByPrincipalId\":\"dntwjchrdgo\",\"createdByUserEmailAddress\":\"xum\",\"principalId\":\"ton\",\"principalTenantId\":\"jl\",\"roleDefinitionId\":\"dfdlwggyts\",\"scope\":\"tov\",\"userAuthenticationType\":\"gseinq\",\"userEmailAddress\":\"ufxqknpirgnepttw\"},\"id\":\"msniffc\",\"name\":\"mqnrojlpijnkr\",\"type\":\"frddhcrati\"}") - .toObject(BillingRoleAssignmentInner.class); - Assertions.assertEquals("ton", model.principalId()); - Assertions.assertEquals("jl", model.principalTenantId()); - Assertions.assertEquals("dfdlwggyts", model.roleDefinitionId()); - Assertions.assertEquals("gseinq", model.userAuthenticationType()); - Assertions.assertEquals("ufxqknpirgnepttw", model.userEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleAssignmentInner model = - new BillingRoleAssignmentInner() - .withPrincipalId("ton") - .withPrincipalTenantId("jl") - .withRoleDefinitionId("dfdlwggyts") - .withUserAuthenticationType("gseinq") - .withUserEmailAddress("ufxqknpirgnepttw"); - model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentInner.class); - Assertions.assertEquals("ton", model.principalId()); - Assertions.assertEquals("jl", model.principalTenantId()); - Assertions.assertEquals("dfdlwggyts", model.roleDefinitionId()); - Assertions.assertEquals("gseinq", model.userAuthenticationType()); - Assertions.assertEquals("ufxqknpirgnepttw", model.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java deleted file mode 100644 index a511766746b1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingRoleAssignmentListResult; - -public final class BillingRoleAssignmentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleAssignmentListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"createdOn\":\"gikyzirtx\",\"createdByPrincipalTenantId\":\"uxzejntpsew\",\"createdByPrincipalId\":\"oi\",\"createdByUserEmailAddress\":\"ukry\",\"principalId\":\"tqmieox\",\"principalTenantId\":\"ggufhyaomtb\",\"roleDefinitionId\":\"havgrvk\",\"scope\":\"ovjzhpjbibgjmfx\",\"userAuthenticationType\":\"vfcluyovwxnbkfe\",\"userEmailAddress\":\"xscyhwzdgirujbz\"},\"id\":\"omvzzbtd\",\"name\":\"qvpn\",\"type\":\"yujviylwdshfssn\"},{\"properties\":{\"createdOn\":\"ye\",\"createdByPrincipalTenantId\":\"ymsgaojfmwnc\",\"createdByPrincipalId\":\"mrfhirctymox\",\"createdByUserEmailAddress\":\"tpipiwyczuhx\",\"principalId\":\"pqjlihhyusps\",\"principalTenantId\":\"sdvlmfwdgzxulucv\",\"roleDefinitionId\":\"mrsreuzvxurisjnh\",\"scope\":\"txifqj\",\"userAuthenticationType\":\"xmrhu\",\"userEmailAddress\":\"wp\"},\"id\":\"esutrgjupauutpw\",\"name\":\"qhih\",\"type\":\"jqgwzp\"},{\"properties\":{\"createdOn\":\"n\",\"createdByPrincipalTenantId\":\"ypsxjvfoim\",\"createdByPrincipalId\":\"slirciz\",\"createdByUserEmailAddress\":\"vydfceacvlhvygdy\",\"principalId\":\"umrtwnawjsl\",\"principalTenantId\":\"wkojgcyztsfmzn\",\"roleDefinitionId\":\"eqphchqnrnr\",\"scope\":\"ehuwrykqgaifmvik\",\"userAuthenticationType\":\"ydv\",\"userEmailAddress\":\"bejdznxcv\"},\"id\":\"srhnjivo\",\"name\":\"v\",\"type\":\"novqfzge\"},{\"properties\":{\"createdOn\":\"ftul\",\"createdByPrincipalTenantId\":\"tduceamt\",\"createdByPrincipalId\":\"zuo\",\"createdByUserEmailAddress\":\"jw\",\"principalId\":\"wqiok\",\"principalTenantId\":\"sx\",\"roleDefinitionId\":\"jmsvpkjp\",\"scope\":\"kwcf\",\"userAuthenticationType\":\"ljyxgtczhe\",\"userEmailAddress\":\"bsdshmkxmaehvbbx\"},\"id\":\"ripltf\",\"name\":\"htba\",\"type\":\"kgxywr\"}],\"nextLink\":\"pyklyhpluodpvru\"}") - .toObject(BillingRoleAssignmentListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleAssignmentListResult model = new BillingRoleAssignmentListResult(); - model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java deleted file mode 100644 index 1e32f048ccb4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentPropertiesTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleAssignmentProperties; -import org.junit.jupiter.api.Assertions; - -public final class BillingRoleAssignmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleAssignmentProperties model = - BinaryData - .fromString( - "{\"createdOn\":\"ronasxift\",\"createdByPrincipalTenantId\":\"qyzhf\",\"createdByPrincipalId\":\"esgogc\",\"createdByUserEmailAddress\":\"onnxkrlgnyhm\",\"principalId\":\"sxkkg\",\"principalTenantId\":\"rrghxjbdhqxvcxgf\",\"roleDefinitionId\":\"dsofbshrns\",\"scope\":\"uswdv\",\"userAuthenticationType\":\"ybycnunvj\",\"userEmailAddress\":\"tkfa\"}") - .toObject(BillingRoleAssignmentProperties.class); - Assertions.assertEquals("sxkkg", model.principalId()); - Assertions.assertEquals("rrghxjbdhqxvcxgf", model.principalTenantId()); - Assertions.assertEquals("dsofbshrns", model.roleDefinitionId()); - Assertions.assertEquals("ybycnunvj", model.userAuthenticationType()); - Assertions.assertEquals("tkfa", model.userEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleAssignmentProperties model = - new BillingRoleAssignmentProperties() - .withPrincipalId("sxkkg") - .withPrincipalTenantId("rrghxjbdhqxvcxgf") - .withRoleDefinitionId("dsofbshrns") - .withUserAuthenticationType("ybycnunvj") - .withUserEmailAddress("tkfa"); - model = BinaryData.fromObject(model).toObject(BillingRoleAssignmentProperties.class); - Assertions.assertEquals("sxkkg", model.principalId()); - Assertions.assertEquals("rrghxjbdhqxvcxgf", model.principalTenantId()); - Assertions.assertEquals("dsofbshrns", model.roleDefinitionId()); - Assertions.assertEquals("ybycnunvj", model.userAuthenticationType()); - Assertions.assertEquals("tkfa", model.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java deleted file mode 100644 index 18b71c4483e6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsDeleteByBillingAccountWithResponseMockTests { - @Test - public void testDeleteByBillingAccountWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"jmvqmtd\",\"createdByPrincipalTenantId\":\"kygroejnndljdj\",\"createdByPrincipalId\":\"kb\",\"createdByUserEmailAddress\":\"eqy\",\"principalId\":\"ceysfaqeg\",\"principalTenantId\":\"wryshwd\",\"roleDefinitionId\":\"vbxgkqusyb\",\"scope\":\"tdacarvvlfn\",\"userAuthenticationType\":\"mt\",\"userEmailAddress\":\"iwenazero\"},\"id\":\"zrsq\",\"name\":\"lsxkd\",\"type\":\"wqapfgsdp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .deleteByBillingAccountWithResponse("zcbyfq", "kfaoytehq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ceysfaqeg", response.principalId()); - Assertions.assertEquals("wryshwd", response.principalTenantId()); - Assertions.assertEquals("vbxgkqusyb", response.roleDefinitionId()); - Assertions.assertEquals("mt", response.userAuthenticationType()); - Assertions.assertEquals("iwenazero", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java deleted file mode 100644 index 40f4f3b7af32..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsDeleteByBillingProfileWithResponseMockTests { - @Test - public void testDeleteByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"mtggmu\",\"createdByPrincipalTenantId\":\"ch\",\"createdByPrincipalId\":\"fnkf\",\"createdByUserEmailAddress\":\"lv\",\"principalId\":\"oakizvoai\",\"principalTenantId\":\"a\",\"roleDefinitionId\":\"nuwiguyxlykwph\",\"scope\":\"zc\",\"userAuthenticationType\":\"hmpejtlkexaonw\",\"userEmailAddress\":\"kcq\"},\"id\":\"rxhxkn\",\"name\":\"ccrmmk\",\"type\":\"upijubyqjfkakfq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .deleteByBillingProfileWithResponse( - "pqigtuujwouhd", "wsigrbjbxsj", "bvitvqkjya", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("oakizvoai", response.principalId()); - Assertions.assertEquals("a", response.principalTenantId()); - Assertions.assertEquals("nuwiguyxlykwph", response.roleDefinitionId()); - Assertions.assertEquals("hmpejtlkexaonw", response.userAuthenticationType()); - Assertions.assertEquals("kcq", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java deleted file mode 100644 index d3e7fb23ab8c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsDeleteByInvoiceSectionWithResponseMockTests { - @Test - public void testDeleteByInvoiceSectionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"kpeeksnbksdqhj\",\"createdByPrincipalTenantId\":\"klxesl\",\"createdByPrincipalId\":\"hustcpoqmavnwqjw\",\"createdByUserEmailAddress\":\"knlejjjkxybwfd\",\"principalId\":\"jbzten\",\"principalTenantId\":\"kzykjtjk\",\"roleDefinitionId\":\"xfwush\",\"scope\":\"pkupnq\",\"userAuthenticationType\":\"gjfbpkuwxeoi\",\"userEmailAddress\":\"fiz\"},\"id\":\"av\",\"name\":\"jzwfb\",\"type\":\"yay\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .deleteByInvoiceSectionWithResponse( - "jsaqwotmmwllcols", "sxap", "efh", "xcgjokjljnhvlq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("jbzten", response.principalId()); - Assertions.assertEquals("kzykjtjk", response.principalTenantId()); - Assertions.assertEquals("xfwush", response.roleDefinitionId()); - Assertions.assertEquals("gjfbpkuwxeoi", response.userAuthenticationType()); - Assertions.assertEquals("fiz", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java deleted file mode 100644 index a34cf3a681c1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsGetByBillingAccountWithResponseMockTests { - @Test - public void testGetByBillingAccountWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"tptnuwjtk\",\"createdByPrincipalTenantId\":\"h\",\"createdByPrincipalId\":\"gqy\",\"createdByUserEmailAddress\":\"eseyqr\",\"principalId\":\"y\",\"principalTenantId\":\"dotjvdk\",\"roleDefinitionId\":\"swskuk\",\"scope\":\"asbvw\",\"userAuthenticationType\":\"pkxkdtxfk\",\"userEmailAddress\":\"lq\"},\"id\":\"twknvgm\",\"name\":\"bugtywatmqa\",\"type\":\"kueatgroeshoy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .getByBillingAccountWithResponse("zffovwmbjl", "qsczpgvdwnapfdqw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("y", response.principalId()); - Assertions.assertEquals("dotjvdk", response.principalTenantId()); - Assertions.assertEquals("swskuk", response.roleDefinitionId()); - Assertions.assertEquals("pkxkdtxfk", response.userAuthenticationType()); - Assertions.assertEquals("lq", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java deleted file mode 100644 index cd442c83b265..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsGetByBillingProfileWithResponseMockTests { - @Test - public void testGetByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"wsrsxkrplbja\",\"createdByPrincipalTenantId\":\"jwwviy\",\"createdByPrincipalId\":\"ps\",\"createdByUserEmailAddress\":\"brnnhjxsqw\",\"principalId\":\"qkbiwet\",\"principalTenantId\":\"zycyqiqyhg\",\"roleDefinitionId\":\"etzlexbsfledynoj\",\"scope\":\"iuwfbzkkdtnhqsy\",\"userAuthenticationType\":\"jselpkpbafvafh\",\"userEmailAddress\":\"ylcc\"},\"id\":\"evxrhyz\",\"name\":\"fwrsofpltdbmair\",\"type\":\"hvhfnracw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .getByBillingProfileWithResponse("mmfz", "bfw", "rzx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qkbiwet", response.principalId()); - Assertions.assertEquals("zycyqiqyhg", response.principalTenantId()); - Assertions.assertEquals("etzlexbsfledynoj", response.roleDefinitionId()); - Assertions.assertEquals("jselpkpbafvafh", response.userAuthenticationType()); - Assertions.assertEquals("ylcc", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java deleted file mode 100644 index e8c9979996e1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsGetByInvoiceSectionWithResponseMockTests { - @Test - public void testGetByInvoiceSectionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"createdOn\":\"htjqvqyvw\",\"createdByPrincipalTenantId\":\"tae\",\"createdByPrincipalId\":\"hzzysevusxiv\",\"createdByUserEmailAddress\":\"rryveimipskdy\",\"principalId\":\"tv\",\"principalTenantId\":\"zkaftjvvrux\",\"roleDefinitionId\":\"gsyeipqdsmjtg\",\"scope\":\"gdgkki\",\"userAuthenticationType\":\"plkcsm\",\"userEmailAddress\":\"hwtbbaedorvvm\"},\"id\":\"floygbdgwumg\",\"name\":\"dgdhpabgdexj\",\"type\":\"d\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleAssignment response = - manager - .billingRoleAssignments() - .getByInvoiceSectionWithResponse("vessm", "hhkuuip", "dqq", "tekva", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("tv", response.principalId()); - Assertions.assertEquals("zkaftjvvrux", response.principalTenantId()); - Assertions.assertEquals("gsyeipqdsmjtg", response.roleDefinitionId()); - Assertions.assertEquals("plkcsm", response.userAuthenticationType()); - Assertions.assertEquals("hwtbbaedorvvm", response.userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java deleted file mode 100644 index acd69f58f245..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingAccountMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdOn\":\"ldudxjascowv\",\"createdByPrincipalTenantId\":\"jkpdxphlkksnm\",\"createdByPrincipalId\":\"vyfijdkzuqnw\",\"createdByUserEmailAddress\":\"thuqolyahluq\",\"principalId\":\"ulsutrjbhxy\",\"principalTenantId\":\"hyqezvqq\",\"roleDefinitionId\":\"drftbcvexreuquo\",\"scope\":\"ljvfwhreagk\",\"userAuthenticationType\":\"xv\",\"userEmailAddress\":\"tvbczsulm\"},\"id\":\"gglmepjpfsey\",\"name\":\"g\",\"type\":\"angpszngafpgyl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingRoleAssignments().listByBillingAccount("rke", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ulsutrjbhxy", response.iterator().next().principalId()); - Assertions.assertEquals("hyqezvqq", response.iterator().next().principalTenantId()); - Assertions.assertEquals("drftbcvexreuquo", response.iterator().next().roleDefinitionId()); - Assertions.assertEquals("xv", response.iterator().next().userAuthenticationType()); - Assertions.assertEquals("tvbczsulm", response.iterator().next().userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java deleted file mode 100644 index 4972f2e26b11..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByBillingProfileMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdOn\":\"iilialwc\",\"createdByPrincipalTenantId\":\"ckbbcc\",\"createdByPrincipalId\":\"zpraoxn\",\"createdByUserEmailAddress\":\"ffatsgftipw\",\"principalId\":\"byubhiqdxyurnpn\",\"principalTenantId\":\"zafccnuhiigb\",\"roleDefinitionId\":\"bui\",\"scope\":\"xvatvcr\",\"userAuthenticationType\":\"lbnb\",\"userEmailAddress\":\"vhcs\"},\"id\":\"hzlwxaea\",\"name\":\"vurex\",\"type\":\"ndsbdw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingRoleAssignments().listByBillingProfile("erppt", "bgqnz", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("byubhiqdxyurnpn", response.iterator().next().principalId()); - Assertions.assertEquals("zafccnuhiigb", response.iterator().next().principalTenantId()); - Assertions.assertEquals("bui", response.iterator().next().roleDefinitionId()); - Assertions.assertEquals("lbnb", response.iterator().next().userAuthenticationType()); - Assertions.assertEquals("vhcs", response.iterator().next().userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java deleted file mode 100644 index fb6464e73fd0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleAssignmentsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleAssignmentsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"createdOn\":\"jfoknubnoitpkp\",\"createdByPrincipalTenantId\":\"rgdg\",\"createdByPrincipalId\":\"coqra\",\"createdByUserEmailAddress\":\"ugyxpqit\",\"principalId\":\"ialwv\",\"principalTenantId\":\"buhzacaq\",\"roleDefinitionId\":\"ltcoqc\",\"scope\":\"pdsxzakuejkm\",\"userAuthenticationType\":\"iztjof\",\"userEmailAddress\":\"vovjufycsjmlbe\"},\"id\":\"yeji\",\"name\":\"iuxegth\",\"type\":\"rtudawlpjfel\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingRoleAssignments() - .listByInvoiceSection("vecjujcn", "oady", "dm", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ialwv", response.iterator().next().principalId()); - Assertions.assertEquals("buhzacaq", response.iterator().next().principalTenantId()); - Assertions.assertEquals("ltcoqc", response.iterator().next().roleDefinitionId()); - Assertions.assertEquals("iztjof", response.iterator().next().userAuthenticationType()); - Assertions.assertEquals("vovjufycsjmlbe", response.iterator().next().userEmailAddress()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java deleted file mode 100644 index 2fce25917723..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionInner; -import java.util.Arrays; - -public final class BillingRoleDefinitionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleDefinitionInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"afxtsgum\",\"permissions\":[{\"actions\":[],\"notActions\":[]},{\"actions\":[],\"notActions\":[]},{\"actions\":[],\"notActions\":[]}],\"roleName\":\"lo\"},\"id\":\"bq\",\"name\":\"vuzlm\",\"type\":\"felfktg\"}") - .toObject(BillingRoleDefinitionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleDefinitionInner model = - new BillingRoleDefinitionInner() - .withPermissions( - Arrays - .asList( - new BillingPermissionsPropertiesInner(), - new BillingPermissionsPropertiesInner(), - new BillingPermissionsPropertiesInner())); - model = BinaryData.fromObject(model).toObject(BillingRoleDefinitionInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java deleted file mode 100644 index 725456c5ea18..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingRoleDefinitionListResult; - -public final class BillingRoleDefinitionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleDefinitionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"phvwauyqncygu\",\"permissions\":[],\"roleName\":\"ipmdscwx\"},\"id\":\"upev\",\"name\":\"hfstotxhojujbyp\",\"type\":\"lmcuvhixb\"},{\"properties\":{\"description\":\"fw\",\"permissions\":[],\"roleName\":\"r\"},\"id\":\"ool\",\"name\":\"ttpkiwkkbnujrywv\",\"type\":\"y\"}],\"nextLink\":\"fpncurdo\"}") - .toObject(BillingRoleDefinitionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleDefinitionListResult model = new BillingRoleDefinitionListResult(); - model = BinaryData.fromObject(model).toObject(BillingRoleDefinitionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java deleted file mode 100644 index 55a08efccb0d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingPermissionsPropertiesInner; -import com.azure.resourcemanager.billing.fluent.models.BillingRoleDefinitionProperties; -import java.util.Arrays; - -public final class BillingRoleDefinitionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingRoleDefinitionProperties model = - BinaryData - .fromString( - "{\"description\":\"crpw\",\"permissions\":[{\"actions\":[\"oi\",\"brnjwmw\",\"pn\"],\"notActions\":[\"zejjoqk\"]},{\"actions\":[\"hsxttaugzxnf\",\"azpxdtnkdmkqjjl\",\"uenvrkp\"],\"notActions\":[\"aibrebqaaysjkixq\",\"nqttezl\",\"fffiak\",\"jpqqmted\"]}],\"roleName\":\"mmji\"}") - .toObject(BillingRoleDefinitionProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingRoleDefinitionProperties model = - new BillingRoleDefinitionProperties() - .withPermissions( - Arrays.asList(new BillingPermissionsPropertiesInner(), new BillingPermissionsPropertiesInner())); - model = BinaryData.fromObject(model).toObject(BillingRoleDefinitionProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java deleted file mode 100644 index b9c07cb1f784..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsGetByBillingAccountWithResponseMockTests { - @Test - public void testGetByBillingAccountWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"ohapqinfsz\",\"permissions\":[],\"roleName\":\"qdhmrjzralcxpjby\"},\"id\":\"psjoqcjenk\",\"name\":\"hf\",\"type\":\"zv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleDefinition response = - manager - .billingRoleDefinitions() - .getByBillingAccountWithResponse("zqro", "tjzcfyjzpt", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java deleted file mode 100644 index 4686844917b0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsGetByBillingProfileWithResponseMockTests { - @Test - public void testGetByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"bklqpxz\",\"permissions\":[],\"roleName\":\"e\"},\"id\":\"dwwnl\",\"name\":\"a\",\"type\":\"wxudgn\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleDefinition response = - manager - .billingRoleDefinitions() - .getByBillingProfileWithResponse( - "fwxzutg", "ztwhghmupg", "yjtcdxabbujftab", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java deleted file mode 100644 index 2cd34bcb3acc..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsGetByInvoiceSectionWithResponseMockTests { - @Test - public void testGetByInvoiceSectionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"s\",\"permissions\":[],\"roleName\":\"jszlb\"},\"id\":\"cmnlzijiufehg\",\"name\":\"vflnwyvqkxrerln\",\"type\":\"ylyl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingRoleDefinition response = - manager - .billingRoleDefinitions() - .getByInvoiceSectionWithResponse( - "qxfx", "elgcmpzqjhhhqx", "w", "vcacoyv", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java deleted file mode 100644 index d6d0536e7de7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingAccountMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"bemeluclvd\",\"permissions\":[],\"roleName\":\"yrdnqod\"},\"id\":\"ahhxhqfaqnvzoqg\",\"name\":\"ipemchgavscz\",\"type\":\"ejdtxptl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingRoleDefinitions().listByBillingAccount("gookrtalvnb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java deleted file mode 100644 index 27990a33c91d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"us\",\"permissions\":[],\"roleName\":\"u\"},\"id\":\"ioycbl\",\"name\":\"vpmclujyxkyxlz\",\"type\":\"sjgkzzltafh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingRoleDefinitions() - .listByBillingProfile("dbrxmrgc", "bapxkiyfjjkb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java deleted file mode 100644 index d775f656d3e4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingRoleDefinitionsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingRoleDefinition; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingRoleDefinitionsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"odrrslblxyd\",\"permissions\":[],\"roleName\":\"vvbxiwkgfbqljnq\"},\"id\":\"hychocokuleh\",\"name\":\"rqlrqffawe\",\"type\":\"urkphyjdxravju\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingRoleDefinitions() - .listByInvoiceSection("h", "zhomewjjstliu", "qawmoaianc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java deleted file mode 100644 index 3acee0e2615e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import org.junit.jupiter.api.Assertions; - -public final class BillingSubscriptionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingSubscriptionInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"pvgqzcjrvxdjzlm\",\"subscriptionId\":\"2b1ddf07-345e-4104-89d5-47cf0f0744f9\",\"subscriptionBillingStatus\":\"Warning\",\"lastMonthCharges\":{\"currency\":\"gfhzovawjvzunlut\",\"value\":1.0469615},\"monthToDateCharges\":{\"currency\":\"nxipeil\",\"value\":42.357708},\"billingProfileId\":\"aejxd\",\"billingProfileDisplayName\":\"tskzbbtdzumveek\",\"costCenter\":\"wozuhkf\",\"customerId\":\"sjyofdx\",\"customerDisplayName\":\"us\",\"invoiceSectionId\":\"touwaboekqv\",\"invoiceSectionDisplayName\":\"lns\",\"reseller\":{\"resellerId\":\"xwyjsflhhc\",\"description\":\"lnjixisxya\"},\"skuId\":\"oyaqcslyjpkiid\",\"skuDescription\":\"exznelixhnr\",\"suspensionReasons\":[\"o\",\"hb\",\"xknalaulppg\"]},\"id\":\"dtpnapnyiropuhp\",\"name\":\"gvpgy\",\"type\":\"gqgitxmedjvcsl\"}") - .toObject(BillingSubscriptionInner.class); - Assertions.assertEquals(BillingSubscriptionStatusType.WARNING, model.subscriptionBillingStatus()); - Assertions.assertEquals("wozuhkf", model.costCenter()); - Assertions.assertEquals("oyaqcslyjpkiid", model.skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingSubscriptionInner model = - new BillingSubscriptionInner() - .withSubscriptionBillingStatus(BillingSubscriptionStatusType.WARNING) - .withCostCenter("wozuhkf") - .withSkuId("oyaqcslyjpkiid"); - model = BinaryData.fromObject(model).toObject(BillingSubscriptionInner.class); - Assertions.assertEquals(BillingSubscriptionStatusType.WARNING, model.subscriptionBillingStatus()); - Assertions.assertEquals("wozuhkf", model.costCenter()); - Assertions.assertEquals("oyaqcslyjpkiid", model.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java deleted file mode 100644 index 5d16bdc6bc4b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionProperties; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import org.junit.jupiter.api.Assertions; - -public final class BillingSubscriptionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingSubscriptionProperties model = - BinaryData - .fromString( - "{\"displayName\":\"qwwncw\",\"subscriptionId\":\"0b14bc39-5e00-4eb5-b288-987d4dfc4e21\",\"subscriptionBillingStatus\":\"Deleted\",\"lastMonthCharges\":{\"currency\":\"trmgucnapkte\",\"value\":45.423527},\"monthToDateCharges\":{\"currency\":\"pt\",\"value\":32.62289},\"billingProfileId\":\"pfqbuaceopzf\",\"billingProfileDisplayName\":\"hhuao\",\"costCenter\":\"pcqeqx\",\"customerId\":\"z\",\"customerDisplayName\":\"hzxct\",\"invoiceSectionId\":\"gbkdmoizpos\",\"invoiceSectionDisplayName\":\"grcfb\",\"reseller\":{\"resellerId\":\"mfqjhhkxbp\",\"description\":\"ymjhxxjyngudivkr\"},\"skuId\":\"wbxqzvszjfau\",\"skuDescription\":\"fdxxivetvtcqaqtd\",\"suspensionReasons\":[\"cbxvwvxyslqbh\",\"fxoblytkb\",\"mpew\"]}") - .toObject(BillingSubscriptionProperties.class); - Assertions.assertEquals(BillingSubscriptionStatusType.DELETED, model.subscriptionBillingStatus()); - Assertions.assertEquals("pcqeqx", model.costCenter()); - Assertions.assertEquals("wbxqzvszjfau", model.skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingSubscriptionProperties model = - new BillingSubscriptionProperties() - .withSubscriptionBillingStatus(BillingSubscriptionStatusType.DELETED) - .withCostCenter("pcqeqx") - .withSkuId("wbxqzvszjfau"); - model = BinaryData.fromObject(model).toObject(BillingSubscriptionProperties.class); - Assertions.assertEquals(BillingSubscriptionStatusType.DELETED, model.subscriptionBillingStatus()); - Assertions.assertEquals("pcqeqx", model.costCenter()); - Assertions.assertEquals("wbxqzvszjfau", model.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java deleted file mode 100644 index 0a8d784af79c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"ctbrxkjzwrgxffm\",\"subscriptionId\":\"2b9128aa-6fd8-48c1-b298-8116567aa8b6\",\"subscriptionBillingStatus\":\"Inactive\",\"lastMonthCharges\":{\"currency\":\"kgozxwop\",\"value\":12.357336},\"monthToDateCharges\":{\"currency\":\"izqaclnapxbiyg\",\"value\":22.492695},\"billingProfileId\":\"knfsmfcttuxuuyil\",\"billingProfileDisplayName\":\"qoiquvrehmrnjhv\",\"costCenter\":\"jztczytqj\",\"customerId\":\"h\",\"customerDisplayName\":\"unfprnjletlxs\",\"invoiceSectionId\":\"pddouifamowaziyn\",\"invoiceSectionDisplayName\":\"lqwzdvpiwhxqsz\",\"reseller\":{\"resellerId\":\"aajquhuxylrj\",\"description\":\"ty\"},\"skuId\":\"bmzyospsps\",\"skuDescription\":\"kfkyjp\",\"suspensionReasons\":[\"bpssdfp\",\"yogtieyujtvczkcn\",\"xrx\"]},\"id\":\"unjdx\",\"name\":\"glnkvxlxpagl\",\"type\":\"ivbgkcv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingSubscription response = - manager.billingSubscriptions().getWithResponse("zvzbglbyv", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(BillingSubscriptionStatusType.INACTIVE, response.subscriptionBillingStatus()); - Assertions.assertEquals("jztczytqj", response.costCenter()); - Assertions.assertEquals("bmzyospsps", response.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java deleted file mode 100644 index f2510d9eec0d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingAccountMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"xfe\",\"subscriptionId\":\"f4cbed26-4a2f-4ca0-a4a6-4fbfd837d0b6\",\"subscriptionBillingStatus\":\"Warning\",\"lastMonthCharges\":{\"currency\":\"xfdeqvhpsyl\",\"value\":14.799225},\"monthToDateCharges\":{\"currency\":\"bffmbmxz\",\"value\":50.71973},\"billingProfileId\":\"wwp\",\"billingProfileDisplayName\":\"xs\",\"costCenter\":\"tf\",\"customerId\":\"gicgaaoepttaq\",\"customerDisplayName\":\"dewemxswv\",\"invoiceSectionId\":\"unzzjgehk\",\"invoiceSectionDisplayName\":\"imrt\",\"reseller\":{\"resellerId\":\"kffqyinljqepqwh\",\"description\":\"monstshiyxgve\"},\"skuId\":\"clduc\",\"skuDescription\":\"irdsvuwcob\",\"suspensionReasons\":[\"stmninwjizcilng\",\"gshejjtbxqmulux\",\"xqzv\",\"ers\"]},\"id\":\"ycucrwnamikzeb\",\"name\":\"qbsms\",\"type\":\"ziqgfuh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingSubscriptions().listByBillingAccount("tcmwqkchc", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - BillingSubscriptionStatusType.WARNING, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("tf", response.iterator().next().costCenter()); - Assertions.assertEquals("clduc", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java deleted file mode 100644 index b082a4f0ed76..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"jsxjwwix\",\"subscriptionId\":\"7b7f70e7-479e-4e08-aadc-7a1077abc191\",\"subscriptionBillingStatus\":\"Warning\",\"lastMonthCharges\":{\"currency\":\"xqhndvnoamlds\",\"value\":35.096104},\"monthToDateCharges\":{\"currency\":\"djh\",\"value\":24.296553},\"billingProfileId\":\"okxcoxp\",\"billingProfileDisplayName\":\"nje\",\"costCenter\":\"gltsxoat\",\"customerId\":\"g\",\"customerDisplayName\":\"npbs\",\"invoiceSectionId\":\"e\",\"invoiceSectionDisplayName\":\"occsr\",\"reseller\":{\"resellerId\":\"ihmipgawtxxpk\",\"description\":\"cxcjxgry\"},\"skuId\":\"mpcycilrmcaykgg\",\"skuDescription\":\"xu\",\"suspensionReasons\":[\"ksxwpnd\",\"cpfnznthjtwkja\",\"srxuzvoam\"]},\"id\":\"tcqiosmg\",\"name\":\"zah\",\"type\":\"xqdlyrtltlapr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingSubscriptions().listByBillingProfile("kzruswh", "hczznvf", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - BillingSubscriptionStatusType.WARNING, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("gltsxoat", response.iterator().next().costCenter()); - Assertions.assertEquals("mpcycilrmcaykgg", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java deleted file mode 100644 index 7a8d00b444c8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByCustomerMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByCustomerMockTests { - @Test - public void testListByCustomer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"qpofvwbc\",\"subscriptionId\":\"014c0863-e775-41aa-8863-c42b70db6758\",\"subscriptionBillingStatus\":\"Active\",\"lastMonthCharges\":{\"currency\":\"kbwvqvxkdiv\",\"value\":15.006906},\"monthToDateCharges\":{\"currency\":\"wtswbzuwfmdur\",\"value\":30.223448},\"billingProfileId\":\"izvcjfe\",\"billingProfileDisplayName\":\"sdjubggbqigkxkbs\",\"costCenter\":\"gak\",\"customerId\":\"cyrcmjdmspo\",\"customerDisplayName\":\"pv\",\"invoiceSectionId\":\"rylniofrzg\",\"invoiceSectionDisplayName\":\"jed\",\"reseller\":{\"resellerId\":\"kvnlvxbcuiiznkt\",\"description\":\"ansnvp\"},\"skuId\":\"bmikost\",\"skuDescription\":\"bkiw\",\"suspensionReasons\":[\"n\",\"ophzfylsgcrp\",\"bcunezzceze\"]},\"id\":\"fwyfwlwxjwet\",\"name\":\"psihcla\",\"type\":\"zvaylptrsqqw\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.billingSubscriptions().listByCustomer("iiqbi", "htmwwinh", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals(BillingSubscriptionStatusType.ACTIVE, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("gak", response.iterator().next().costCenter()); - Assertions.assertEquals("bmikost", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java deleted file mode 100644 index a5d107a422e4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"qalarvlagunbtg\",\"subscriptionId\":\"5c8b1f82-54e3-4784-976b-0399b9cc76f0\",\"subscriptionBillingStatus\":\"Inactive\",\"lastMonthCharges\":{\"currency\":\"bmhyreeudz\",\"value\":93.786156},\"monthToDateCharges\":{\"currency\":\"dqmjxly\",\"value\":29.41463},\"billingProfileId\":\"gouwtlmj\",\"billingProfileDisplayName\":\"uojqt\",\"costCenter\":\"axkjeytunlbfjk\",\"customerId\":\"u\",\"customerDisplayName\":\"kqbh\",\"invoiceSectionId\":\"rqunjq\",\"invoiceSectionDisplayName\":\"enx\",\"reseller\":{\"resellerId\":\"kpak\",\"description\":\"ifmjnn\"},\"skuId\":\"tqabpxuckpgg\",\"skuDescription\":\"wey\",\"suspensionReasons\":[\"hlisngw\",\"lqqmpiz\",\"uwnpqxpxiwfcng\",\"saasiixtmkzj\"]},\"id\":\"kv\",\"name\":\"irhgfgrwsdp\",\"type\":\"ra\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .billingSubscriptions() - .listByInvoiceSection("tz", "atbhjmznn", "s", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - BillingSubscriptionStatusType.INACTIVE, response.iterator().next().subscriptionBillingStatus()); - Assertions.assertEquals("axkjeytunlbfjk", response.iterator().next().costCenter()); - Assertions.assertEquals("tqabpxuckpgg", response.iterator().next().skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java deleted file mode 100644 index 5993ce87d082..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.BillingSubscriptionsListResult; - -public final class BillingSubscriptionsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BillingSubscriptionsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"ck\",\"subscriptionId\":\"57d84afc-8b50-4f1e-81a9-e9cf06197dda\",\"subscriptionBillingStatus\":\"Warning\",\"billingProfileId\":\"bkyvp\",\"billingProfileDisplayName\":\"anuzbpzkafkuw\",\"costCenter\":\"rnwb\",\"customerId\":\"hhseyv\",\"customerDisplayName\":\"srtslhspkdeem\",\"invoiceSectionId\":\"fm\",\"invoiceSectionDisplayName\":\"gkvtmelmqkrhah\",\"skuId\":\"uahaquhcdhmd\",\"skuDescription\":\"laexqp\",\"suspensionReasons\":[]},\"id\":\"adm\",\"name\":\"sr\",\"type\":\"r\"},{\"properties\":{\"displayName\":\"pv\",\"subscriptionId\":\"bf8b6a2e-e5b5-4b61-aff8-d9ee31509c78\",\"subscriptionBillingStatus\":\"Warning\",\"billingProfileId\":\"isgwbnbbeldawkz\",\"billingProfileDisplayName\":\"liourqhak\",\"costCenter\":\"hashsfwxosow\",\"customerId\":\"cugicjoox\",\"customerDisplayName\":\"ebwpucwwfvo\",\"invoiceSectionId\":\"vmeueci\",\"invoiceSectionDisplayName\":\"hzceuojgjrwjue\",\"skuId\":\"wmcdytdxwi\",\"skuDescription\":\"nrjawgqwg\",\"suspensionReasons\":[]},\"id\":\"ni\",\"name\":\"kxfbkpycgklwndn\",\"type\":\"jdauwhvy\"},{\"properties\":{\"displayName\":\"btdhxujznbm\",\"subscriptionId\":\"ea622ed2-d4f9-469e-9daf-f1e91e5801ed\",\"subscriptionBillingStatus\":\"Abandoned\",\"billingProfileId\":\"zqlveualupjmkhf\",\"billingProfileDisplayName\":\"bbcswsrtjri\",\"costCenter\":\"rbpbewtghfgblcg\",\"customerId\":\"zvlvqhjkbegib\",\"customerDisplayName\":\"mxiebw\",\"invoiceSectionId\":\"loayqcgw\",\"invoiceSectionDisplayName\":\"zjuzgwyz\",\"skuId\":\"xongmtsavjcbpwxq\",\"skuDescription\":\"rknftguvriuhprwm\",\"suspensionReasons\":[]},\"id\":\"vxqtayriwwroyqbe\",\"name\":\"rmcqiby\",\"type\":\"nojvknmefqsg\"}],\"totalCount\":488274582,\"nextLink\":\"apj\"}") - .toObject(BillingSubscriptionsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BillingSubscriptionsListResult model = new BillingSubscriptionsListResult(); - model = BinaryData.fromObject(model).toObject(BillingSubscriptionsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java deleted file mode 100644 index ee599838fb87..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsMoveMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsMoveMockTests { - @Test - public void testMove() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"ycxhxzgaztta\",\"subscriptionId\":\"d3cdb36f-7903-46a6-b127-4f7fed731bfc\",\"subscriptionBillingStatus\":\"Inactive\",\"lastMonthCharges\":{\"currency\":\"fqhppubowsep\",\"value\":1.4296412},\"monthToDateCharges\":{\"currency\":\"tdherngbtcjuahok\",\"value\":60.235302},\"billingProfileId\":\"kauxof\",\"billingProfileDisplayName\":\"fphwpnu\",\"costCenter\":\"iywzejy\",\"customerId\":\"slwkojpl\",\"customerDisplayName\":\"dnpdwrpqaf\",\"invoiceSectionId\":\"ug\",\"invoiceSectionDisplayName\":\"n\",\"reseller\":{\"resellerId\":\"et\",\"description\":\"ypococtfjgtixr\"},\"skuId\":\"zuyt\",\"skuDescription\":\"mlmuowol\",\"suspensionReasons\":[\"iropionszon\"]},\"id\":\"pngajin\",\"name\":\"ixjawrtm\",\"type\":\"fjmyccxlzhco\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingSubscription response = - manager - .billingSubscriptions() - .move( - "ffifhx", - new TransferBillingSubscriptionRequestProperties() - .withDestinationInvoiceSectionId("rsnewmozqvbubqma"), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals(BillingSubscriptionStatusType.INACTIVE, response.subscriptionBillingStatus()); - Assertions.assertEquals("iywzejy", response.costCenter()); - Assertions.assertEquals("zuyt", response.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java deleted file mode 100644 index 9aa90fa79e15..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/BillingSubscriptionsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.BillingSubscriptionInner; -import com.azure.resourcemanager.billing.models.BillingSubscription; -import com.azure.resourcemanager.billing.models.BillingSubscriptionStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class BillingSubscriptionsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"nykzcugswvxwlm\",\"subscriptionId\":\"be4a2676-00c5-4065-a604-86209c2a264f\",\"subscriptionBillingStatus\":\"Abandoned\",\"lastMonthCharges\":{\"currency\":\"xnjmxm\",\"value\":51.97202},\"monthToDateCharges\":{\"currency\":\"tcvcl\",\"value\":25.977707},\"billingProfileId\":\"dkvgfabuiyjibuzp\",\"billingProfileDisplayName\":\"ugneikn\",\"costCenter\":\"oxgjiuqhibt\",\"customerId\":\"ipq\",\"customerDisplayName\":\"edmurrxxge\",\"invoiceSectionId\":\"ktvqylkmqpzoy\",\"invoiceSectionDisplayName\":\"fbcgwgcloxoebqin\",\"reseller\":{\"resellerId\":\"nwjfu\",\"description\":\"lafcbahh\"},\"skuId\":\"pofoi\",\"skuDescription\":\"w\",\"suspensionReasons\":[\"lkmkkholvdndvi\",\"uogphuartvtiuky\"]},\"id\":\"fchnmnah\",\"name\":\"nxhkxjqi\",\"type\":\"wrweoo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - BillingSubscription response = - manager - .billingSubscriptions() - .updateWithResponse( - "hpzvuqdflvoniyp", - new BillingSubscriptionInner() - .withSubscriptionBillingStatus(BillingSubscriptionStatusType.INACTIVE) - .withCostCenter("nq") - .withSkuId("lacjfrnxo"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(BillingSubscriptionStatusType.ABANDONED, response.subscriptionBillingStatus()); - Assertions.assertEquals("oxgjiuqhibt", response.costCenter()); - Assertions.assertEquals("pofoi", response.skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java deleted file mode 100644 index cdd7a54c9bfe..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerInnerTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerInner; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomerInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerInner model = - BinaryData - .fromString( - "{\"properties\":{\"billingProfileId\":\"l\",\"billingProfileDisplayName\":\"kx\",\"displayName\":\"skpbhenbtkcxywn\",\"enabledAzurePlans\":[{\"skuId\":\"synlqidybyxczfc\",\"skuDescription\":\"aaxdbabphlwrq\"}],\"resellers\":[{\"resellerId\":\"sthsu\",\"description\":\"cmnyyazttb\"},{\"resellerId\":\"wrqpue\",\"description\":\"kzywbiex\"},{\"resellerId\":\"eyueaxibxujwb\",\"description\":\"walm\"},{\"resellerId\":\"yoxa\",\"description\":\"dkzjancuxrh\"}]},\"id\":\"wbavxbniwdj\",\"name\":\"wz\",\"type\":\"s\"}") - .toObject(CustomerInner.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.displayName()); - Assertions.assertEquals("synlqidybyxczfc", model.enabledAzurePlans().get(0).skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerInner model = - new CustomerInner() - .withDisplayName("skpbhenbtkcxywn") - .withEnabledAzurePlans(Arrays.asList(new AzurePlan().withSkuId("synlqidybyxczfc"))) - .withResellers(Arrays.asList(new Reseller(), new Reseller(), new Reseller(), new Reseller())); - model = BinaryData.fromObject(model).toObject(CustomerInner.class); - Assertions.assertEquals("skpbhenbtkcxywn", model.displayName()); - Assertions.assertEquals("synlqidybyxczfc", model.enabledAzurePlans().get(0).skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java deleted file mode 100644 index 8ba53626bb2f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.CustomerListResult; - -public final class CustomerListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"billingProfileId\":\"kgj\",\"billingProfileDisplayName\":\"yoxgvcltbgsnc\",\"displayName\":\"kjeszz\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"jhtxfvgxbfsmxne\",\"name\":\"mpvecxgodebfqk\",\"type\":\"rbmpukgri\"},{\"properties\":{\"billingProfileId\":\"zlfbxzpuzycispnq\",\"billingProfileDisplayName\":\"hmgkbrpyy\",\"displayName\":\"ibnuqqkpik\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"gvtqagnbuynh\",\"name\":\"jggmebfsiarbu\",\"type\":\"rcvpnazzmhjrunmp\"}],\"totalCount\":18555434,\"nextLink\":\"bh\"}") - .toObject(CustomerListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerListResult model = new CustomerListResult(); - model = BinaryData.fromObject(model).toObject(CustomerListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java deleted file mode 100644 index ee30de207ea8..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.models.ViewCharges; -import org.junit.jupiter.api.Assertions; - -public final class CustomerPolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerPolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"viewCharges\":\"Allowed\"},\"id\":\"blmhvkzuhb\",\"name\":\"vvyhg\",\"type\":\"opbyrqufegxu\"}") - .toObject(CustomerPolicyInner.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerPolicyInner model = new CustomerPolicyInner().withViewCharges(ViewCharges.ALLOWED); - model = BinaryData.fromObject(model).toObject(CustomerPolicyInner.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java deleted file mode 100644 index ad21f446961c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPolicyPropertiesTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyProperties; -import com.azure.resourcemanager.billing.models.ViewCharges; -import org.junit.jupiter.api.Assertions; - -public final class CustomerPolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerPolicyProperties model = - BinaryData.fromString("{\"viewCharges\":\"Allowed\"}").toObject(CustomerPolicyProperties.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerPolicyProperties model = new CustomerPolicyProperties().withViewCharges(ViewCharges.ALLOWED); - model = BinaryData.fromObject(model).toObject(CustomerPolicyProperties.class); - Assertions.assertEquals(ViewCharges.ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java deleted file mode 100644 index ae57b85f0fbb..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomerPropertiesTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.CustomerProperties; -import com.azure.resourcemanager.billing.models.AzurePlan; -import com.azure.resourcemanager.billing.models.Reseller; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CustomerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomerProperties model = - BinaryData - .fromString( - "{\"billingProfileId\":\"pgn\",\"billingProfileDisplayName\":\"txhp\",\"displayName\":\"bzpfzab\",\"enabledAzurePlans\":[{\"skuId\":\"hxw\",\"skuDescription\":\"tyq\"}],\"resellers\":[{\"resellerId\":\"bovpl\",\"description\":\"bhvgy\"},{\"resellerId\":\"uosvmkfssxqukk\",\"description\":\"l\"}]}") - .toObject(CustomerProperties.class); - Assertions.assertEquals("bzpfzab", model.displayName()); - Assertions.assertEquals("hxw", model.enabledAzurePlans().get(0).skuId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomerProperties model = - new CustomerProperties() - .withDisplayName("bzpfzab") - .withEnabledAzurePlans(Arrays.asList(new AzurePlan().withSkuId("hxw"))) - .withResellers(Arrays.asList(new Reseller(), new Reseller())); - model = BinaryData.fromObject(model).toObject(CustomerProperties.class); - Assertions.assertEquals("bzpfzab", model.displayName()); - Assertions.assertEquals("hxw", model.enabledAzurePlans().get(0).skuId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java deleted file mode 100644 index 1a3aa1ce2c34..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Customer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomersGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"billingProfileId\":\"snmfpphojeevy\",\"billingProfileDisplayName\":\"hsgz\",\"displayName\":\"zbgomfgbeg\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"o\",\"name\":\"i\",\"type\":\"etnluankrrfx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Customer response = - manager - .customers() - .getWithResponse("tfnmdx", "tngfdgugeyzihgr", "yui", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zbgomfgbeg", response.displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java deleted file mode 100644 index da483feb0537..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingAccountMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Customer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomersListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"billingProfileId\":\"aiouaubrjt\",\"billingProfileDisplayName\":\"qxfuojrngif\",\"displayName\":\"z\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"biuimzdlyjdfq\",\"name\":\"mkyoqufdvruzsl\",\"type\":\"ojhp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .customers() - .listByBillingAccount("qbnj", "rcgegydcwboxjum", "qqoli", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("z", response.iterator().next().displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java deleted file mode 100644 index 2c114cfd1861..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/CustomersListByBillingProfileMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Customer; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomersListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"billingProfileId\":\"cxkjibnxmysuxswq\",\"billingProfileDisplayName\":\"tvlwijpsttexoq\",\"displayName\":\"wcyyufmhruncu\",\"enabledAzurePlans\":[],\"resellers\":[]},\"id\":\"kcdqzhlct\",\"name\":\"dunqnd\",\"type\":\"fpch\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .customers() - .listByBillingProfile("xzsrzpge", "q", "yb", "wwpgdakchzyvlixq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wcyyufmhruncu", response.iterator().next().displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java deleted file mode 100644 index 4dbe4734eb21..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentPropertiesTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.DepartmentProperties; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DepartmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DepartmentProperties model = - BinaryData - .fromString( - "{\"departmentName\":\"pg\",\"costCenter\":\"toc\",\"status\":\"xhvpmoue\",\"enrollmentAccounts\":[{\"properties\":{\"accountName\":\"i\",\"costCenter\":\"eojnxqbzvddn\",\"accountOwner\":\"ndei\",\"accountOwnerEmail\":\"twnpzaoqvuhrhcf\",\"status\":\"yd\",\"startDate\":\"2021-01-15T04:12:24Z\",\"endDate\":\"2021-08-14T20:27:10Z\"},\"id\":\"hjq\",\"name\":\"wpyeicxmqciwqvh\",\"type\":\"hix\"},{\"properties\":{\"accountName\":\"dtopbob\",\"costCenter\":\"ghmewuam\",\"accountOwner\":\"hrzayvvtpgvdf\",\"accountOwnerEmail\":\"otkftutqxlngx\",\"status\":\"fgugnxkrxdqmid\",\"startDate\":\"2021-09-08T21:12:41Z\",\"endDate\":\"2021-06-28T04:41:07Z\"},\"id\":\"qdrabhjybigehoqf\",\"name\":\"owskanyktz\",\"type\":\"cuiywgqyw\"},{\"properties\":{\"accountName\":\"rvynhzgpph\",\"costCenter\":\"gyncocpecfvmmc\",\"accountOwner\":\"fsxlzevgbmqjqa\",\"accountOwnerEmail\":\"y\",\"status\":\"ivkwlzuvccfwnfnb\",\"startDate\":\"2021-04-04T07:21:26Z\",\"endDate\":\"2021-04-16T12:59:12Z\"},\"id\":\"l\",\"name\":\"bxetqgtzxdpn\",\"type\":\"bqqwxrj\"},{\"properties\":{\"accountName\":\"llnwsubi\",\"costCenter\":\"jampmngnzscxaqw\",\"accountOwner\":\"chcbonqvpkvlrxnj\",\"accountOwnerEmail\":\"seiphe\",\"status\":\"lokeyy\",\"startDate\":\"2021-09-18T17:01:56Z\",\"endDate\":\"2021-10-04T06:36:31Z\"},\"id\":\"lwtgrhpdj\",\"name\":\"jumasx\",\"type\":\"zj\"}]}") - .toObject(DepartmentProperties.class); - Assertions.assertEquals("pg", model.departmentName()); - Assertions.assertEquals("toc", model.costCenter()); - Assertions.assertEquals("xhvpmoue", model.status()); - Assertions.assertEquals("i", model.enrollmentAccounts().get(0).accountName()); - Assertions.assertEquals("eojnxqbzvddn", model.enrollmentAccounts().get(0).costCenter()); - Assertions.assertEquals("ndei", model.enrollmentAccounts().get(0).accountOwner()); - Assertions.assertEquals("twnpzaoqvuhrhcf", model.enrollmentAccounts().get(0).accountOwnerEmail()); - Assertions.assertEquals("yd", model.enrollmentAccounts().get(0).status()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-15T04:12:24Z"), model.enrollmentAccounts().get(0).startDate()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-08-14T20:27:10Z"), model.enrollmentAccounts().get(0).endDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DepartmentProperties model = - new DepartmentProperties() - .withDepartmentName("pg") - .withCostCenter("toc") - .withStatus("xhvpmoue") - .withEnrollmentAccounts( - Arrays - .asList( - new EnrollmentAccount() - .withAccountName("i") - .withCostCenter("eojnxqbzvddn") - .withAccountOwner("ndei") - .withAccountOwnerEmail("twnpzaoqvuhrhcf") - .withStatus("yd") - .withStartDate(OffsetDateTime.parse("2021-01-15T04:12:24Z")) - .withEndDate(OffsetDateTime.parse("2021-08-14T20:27:10Z")), - new EnrollmentAccount() - .withAccountName("dtopbob") - .withCostCenter("ghmewuam") - .withAccountOwner("hrzayvvtpgvdf") - .withAccountOwnerEmail("otkftutqxlngx") - .withStatus("fgugnxkrxdqmid") - .withStartDate(OffsetDateTime.parse("2021-09-08T21:12:41Z")) - .withEndDate(OffsetDateTime.parse("2021-06-28T04:41:07Z")), - new EnrollmentAccount() - .withAccountName("rvynhzgpph") - .withCostCenter("gyncocpecfvmmc") - .withAccountOwner("fsxlzevgbmqjqa") - .withAccountOwnerEmail("y") - .withStatus("ivkwlzuvccfwnfnb") - .withStartDate(OffsetDateTime.parse("2021-04-04T07:21:26Z")) - .withEndDate(OffsetDateTime.parse("2021-04-16T12:59:12Z")), - new EnrollmentAccount() - .withAccountName("llnwsubi") - .withCostCenter("jampmngnzscxaqw") - .withAccountOwner("chcbonqvpkvlrxnj") - .withAccountOwnerEmail("seiphe") - .withStatus("lokeyy") - .withStartDate(OffsetDateTime.parse("2021-09-18T17:01:56Z")) - .withEndDate(OffsetDateTime.parse("2021-10-04T06:36:31Z")))); - model = BinaryData.fromObject(model).toObject(DepartmentProperties.class); - Assertions.assertEquals("pg", model.departmentName()); - Assertions.assertEquals("toc", model.costCenter()); - Assertions.assertEquals("xhvpmoue", model.status()); - Assertions.assertEquals("i", model.enrollmentAccounts().get(0).accountName()); - Assertions.assertEquals("eojnxqbzvddn", model.enrollmentAccounts().get(0).costCenter()); - Assertions.assertEquals("ndei", model.enrollmentAccounts().get(0).accountOwner()); - Assertions.assertEquals("twnpzaoqvuhrhcf", model.enrollmentAccounts().get(0).accountOwnerEmail()); - Assertions.assertEquals("yd", model.enrollmentAccounts().get(0).status()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-01-15T04:12:24Z"), model.enrollmentAccounts().get(0).startDate()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-08-14T20:27:10Z"), model.enrollmentAccounts().get(0).endDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java deleted file mode 100644 index 51f7b45d5b2f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DepartmentTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Department; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DepartmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Department model = - BinaryData - .fromString( - "{\"properties\":{\"departmentName\":\"hhbcsglummajtjao\",\"costCenter\":\"obnbdxkqpxokaj\",\"status\":\"npime\",\"enrollmentAccounts\":[{\"id\":\"xgcp\",\"name\":\"dg\",\"type\":\"aajrm\"},{\"id\":\"jwzrl\",\"name\":\"vmclw\",\"type\":\"ijcoejctb\"}]},\"id\":\"aqsqsycbkbfk\",\"name\":\"ukdkexxppofmxa\",\"type\":\"c\"}") - .toObject(Department.class); - Assertions.assertEquals("hhbcsglummajtjao", model.departmentName()); - Assertions.assertEquals("obnbdxkqpxokaj", model.costCenter()); - Assertions.assertEquals("npime", model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Department model = - new Department() - .withDepartmentName("hhbcsglummajtjao") - .withCostCenter("obnbdxkqpxokaj") - .withStatus("npime") - .withEnrollmentAccounts(Arrays.asList(new EnrollmentAccount(), new EnrollmentAccount())); - model = BinaryData.fromObject(model).toObject(Department.class); - Assertions.assertEquals("hhbcsglummajtjao", model.departmentName()); - Assertions.assertEquals("obnbdxkqpxokaj", model.costCenter()); - Assertions.assertEquals("npime", model.status()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java deleted file mode 100644 index 4beb0e904a48..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DocumentTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Document; - -public final class DocumentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Document model = - BinaryData - .fromString("{\"kind\":\"VoidNote\",\"url\":\"egokdwbwhkszzcmr\",\"source\":\"ENF\"}") - .toObject(Document.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Document model = new Document(); - model = BinaryData.fromObject(model).toObject(Document.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java deleted file mode 100644 index 3f5a837aba0f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/DownloadUrlInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.DownloadUrlInner; - -public final class DownloadUrlInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DownloadUrlInner model = - BinaryData - .fromString("{\"expiryTime\":\"2021-09-27T05:33:50Z\",\"url\":\"grtwae\"}") - .toObject(DownloadUrlInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DownloadUrlInner model = new DownloadUrlInner(); - model = BinaryData.fromObject(model).toObject(DownloadUrlInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java deleted file mode 100644 index a6e7c470c1ea..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.EnrollmentAccountListResult; - -public final class EnrollmentAccountListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"principalName\":\"f\"},\"id\":\"fcjnaeoisrvhmgor\",\"name\":\"fukiscvwmzhw\",\"type\":\"lefaxvxilcbtgn\"},{\"properties\":{\"principalName\":\"eyqxtjjfzql\"},\"id\":\"hycav\",\"name\":\"dggxdbeesmi\",\"type\":\"knlrariaawiuagy\"},{\"properties\":{\"principalName\":\"fbylyrfg\"},\"id\":\"agt\",\"name\":\"ojocqwogf\",\"type\":\"zjvusfzldmo\"}],\"nextLink\":\"xylfsb\"}") - .toObject(EnrollmentAccountListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountListResult model = new EnrollmentAccountListResult(); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java deleted file mode 100644 index 4ab1938bb115..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountPropertiesTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountProperties; -import com.azure.resourcemanager.billing.models.Department; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EnrollmentAccountPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountProperties model = - BinaryData - .fromString( - "{\"accountName\":\"dkcglhsl\",\"costCenter\":\"jdyggdtji\",\"accountOwner\":\"b\",\"accountOwnerEmail\":\"ofqweykhmenevfye\",\"status\":\"whybcib\",\"startDate\":\"2021-05-14T16:24:46Z\",\"endDate\":\"2021-01-31T06:13:45Z\",\"department\":{\"properties\":{\"departmentName\":\"ynnaam\",\"costCenter\":\"ctehfiqscjey\",\"status\":\"hezrkgq\",\"enrollmentAccounts\":[]},\"id\":\"refovgmkqsleyyvx\",\"name\":\"qjpkcattpngjcrc\",\"type\":\"zsqpjhvmdajvny\"}}") - .toObject(EnrollmentAccountProperties.class); - Assertions.assertEquals("dkcglhsl", model.accountName()); - Assertions.assertEquals("jdyggdtji", model.costCenter()); - Assertions.assertEquals("b", model.accountOwner()); - Assertions.assertEquals("ofqweykhmenevfye", model.accountOwnerEmail()); - Assertions.assertEquals("whybcib", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T16:24:46Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T06:13:45Z"), model.endDate()); - Assertions.assertEquals("ynnaam", model.department().departmentName()); - Assertions.assertEquals("ctehfiqscjey", model.department().costCenter()); - Assertions.assertEquals("hezrkgq", model.department().status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountProperties model = - new EnrollmentAccountProperties() - .withAccountName("dkcglhsl") - .withCostCenter("jdyggdtji") - .withAccountOwner("b") - .withAccountOwnerEmail("ofqweykhmenevfye") - .withStatus("whybcib") - .withStartDate(OffsetDateTime.parse("2021-05-14T16:24:46Z")) - .withEndDate(OffsetDateTime.parse("2021-01-31T06:13:45Z")) - .withDepartment( - new Department() - .withDepartmentName("ynnaam") - .withCostCenter("ctehfiqscjey") - .withStatus("hezrkgq") - .withEnrollmentAccounts(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountProperties.class); - Assertions.assertEquals("dkcglhsl", model.accountName()); - Assertions.assertEquals("jdyggdtji", model.costCenter()); - Assertions.assertEquals("b", model.accountOwner()); - Assertions.assertEquals("ofqweykhmenevfye", model.accountOwnerEmail()); - Assertions.assertEquals("whybcib", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T16:24:46Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T06:13:45Z"), model.endDate()); - Assertions.assertEquals("ynnaam", model.department().departmentName()); - Assertions.assertEquals("ctehfiqscjey", model.department().costCenter()); - Assertions.assertEquals("hezrkgq", model.department().status()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java deleted file mode 100644 index 67997837bb62..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryInner; - -public final class EnrollmentAccountSummaryInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountSummaryInner model = - BinaryData - .fromString( - "{\"properties\":{\"principalName\":\"dp\"},\"id\":\"s\",\"name\":\"wn\",\"type\":\"tgkbugrjqctojc\"}") - .toObject(EnrollmentAccountSummaryInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountSummaryInner model = new EnrollmentAccountSummaryInner(); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountSummaryInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java deleted file mode 100644 index 2cef8c3b4460..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountSummaryPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.EnrollmentAccountSummaryProperties; - -public final class EnrollmentAccountSummaryPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccountSummaryProperties model = - BinaryData - .fromString("{\"principalName\":\"sofieypefojyqd\"}") - .toObject(EnrollmentAccountSummaryProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccountSummaryProperties model = new EnrollmentAccountSummaryProperties(); - model = BinaryData.fromObject(model).toObject(EnrollmentAccountSummaryProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java deleted file mode 100644 index 8025c43c1c06..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Department; -import com.azure.resourcemanager.billing.models.EnrollmentAccount; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class EnrollmentAccountTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentAccount model = - BinaryData - .fromString( - "{\"properties\":{\"accountName\":\"e\",\"costCenter\":\"alhbx\",\"accountOwner\":\"e\",\"accountOwnerEmail\":\"zzvdudgwds\",\"status\":\"hotwmcynpwlbjnp\",\"startDate\":\"2021-06-10T20:31:16Z\",\"endDate\":\"2021-04-17T12:51:37Z\",\"department\":{\"id\":\"ehxnltyfsop\",\"name\":\"usue\",\"type\":\"nzwdejba\"}},\"id\":\"orxzdmohctbqvud\",\"name\":\"xdn\",\"type\":\"nvowgujju\"}") - .toObject(EnrollmentAccount.class); - Assertions.assertEquals("e", model.accountName()); - Assertions.assertEquals("alhbx", model.costCenter()); - Assertions.assertEquals("e", model.accountOwner()); - Assertions.assertEquals("zzvdudgwds", model.accountOwnerEmail()); - Assertions.assertEquals("hotwmcynpwlbjnp", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T20:31:16Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T12:51:37Z"), model.endDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentAccount model = - new EnrollmentAccount() - .withAccountName("e") - .withCostCenter("alhbx") - .withAccountOwner("e") - .withAccountOwnerEmail("zzvdudgwds") - .withStatus("hotwmcynpwlbjnp") - .withStartDate(OffsetDateTime.parse("2021-06-10T20:31:16Z")) - .withEndDate(OffsetDateTime.parse("2021-04-17T12:51:37Z")) - .withDepartment(new Department()); - model = BinaryData.fromObject(model).toObject(EnrollmentAccount.class); - Assertions.assertEquals("e", model.accountName()); - Assertions.assertEquals("alhbx", model.costCenter()); - Assertions.assertEquals("e", model.accountOwner()); - Assertions.assertEquals("zzvdudgwds", model.accountOwnerEmail()); - Assertions.assertEquals("hotwmcynpwlbjnp", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T20:31:16Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T12:51:37Z"), model.endDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java deleted file mode 100644 index 4610563f8701..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnrollmentAccountsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principalName\":\"cvtlubseskvc\"},\"id\":\"artr\",\"name\":\"unlpirykycndz\",\"type\":\"qi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - EnrollmentAccountSummary response = - manager.enrollmentAccounts().getWithResponse("fgvmx", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java deleted file mode 100644 index 0611c06bd47c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentAccountsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.EnrollmentAccountSummary; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class EnrollmentAccountsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principalName\":\"fytpqsixymmpuji\"},\"id\":\"yqlkju\",\"name\":\"smbmslzoy\",\"type\":\"vwzdbpqvyb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.enrollmentAccounts().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java deleted file mode 100644 index 474c62f78de7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/EnrollmentPoliciesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.EnrollmentPolicies; - -public final class EnrollmentPoliciesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnrollmentPolicies model = - BinaryData - .fromString( - "{\"accountOwnerViewCharges\":false,\"departmentAdminViewCharges\":false,\"marketplaceEnabled\":false,\"reservedInstancesEnabled\":true}") - .toObject(EnrollmentPolicies.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnrollmentPolicies model = new EnrollmentPolicies(); - model = BinaryData.fromObject(model).toObject(EnrollmentPolicies.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java deleted file mode 100644 index 6043de8cbb2c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/IndirectRelationshipInfoTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.IndirectRelationshipInfo; -import org.junit.jupiter.api.Assertions; - -public final class IndirectRelationshipInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IndirectRelationshipInfo model = - BinaryData - .fromString( - "{\"billingAccountName\":\"bdkvwrwjf\",\"billingProfileName\":\"snhu\",\"displayName\":\"eltmrldhugjzzdat\"}") - .toObject(IndirectRelationshipInfo.class); - Assertions.assertEquals("bdkvwrwjf", model.billingAccountName()); - Assertions.assertEquals("snhu", model.billingProfileName()); - Assertions.assertEquals("eltmrldhugjzzdat", model.displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IndirectRelationshipInfo model = - new IndirectRelationshipInfo() - .withBillingAccountName("bdkvwrwjf") - .withBillingProfileName("snhu") - .withDisplayName("eltmrldhugjzzdat"); - model = BinaryData.fromObject(model).toObject(IndirectRelationshipInfo.class); - Assertions.assertEquals("bdkvwrwjf", model.billingAccountName()); - Assertions.assertEquals("snhu", model.billingProfileName()); - Assertions.assertEquals("eltmrldhugjzzdat", model.displayName()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java deleted file mode 100644 index 29983a65ecb5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class InstructionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstructionInner model = - BinaryData - .fromString( - "{\"properties\":{\"amount\":10.419273,\"startDate\":\"2021-09-25T01:29:01Z\",\"endDate\":\"2021-09-15T09:48:55Z\",\"creationDate\":\"2021-10-30T19:28:33Z\"},\"id\":\"ypewrmjmwvvjekt\",\"name\":\"xsenhwlr\",\"type\":\"ffrzpwvlqdqgbiqy\"}") - .toObject(InstructionInner.class); - Assertions.assertEquals(10.419273f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T01:29:01Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T09:48:55Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T19:28:33Z"), model.creationDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstructionInner model = - new InstructionInner() - .withAmount(10.419273f) - .withStartDate(OffsetDateTime.parse("2021-09-25T01:29:01Z")) - .withEndDate(OffsetDateTime.parse("2021-09-15T09:48:55Z")) - .withCreationDate(OffsetDateTime.parse("2021-10-30T19:28:33Z")); - model = BinaryData.fromObject(model).toObject(InstructionInner.class); - Assertions.assertEquals(10.419273f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-25T01:29:01Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-15T09:48:55Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-30T19:28:33Z"), model.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java deleted file mode 100644 index ad555a22127e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.InstructionListResult; - -public final class InstructionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstructionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"amount\":14.028668,\"startDate\":\"2021-02-05T11:01:53Z\",\"endDate\":\"2021-08-09T18:56:36Z\",\"creationDate\":\"2021-10-09T04:22:59Z\"},\"id\":\"yhxdeoejzicwi\",\"name\":\"sjttgzfbish\",\"type\":\"bkh\"},{\"properties\":{\"amount\":99.54184,\"startDate\":\"2021-05-05T10:08:59Z\",\"endDate\":\"2021-10-22T18:26:04Z\",\"creationDate\":\"2021-07-28T01:41:30Z\"},\"id\":\"md\",\"name\":\"hagalpbuxwgipwh\",\"type\":\"nowkgshw\"},{\"properties\":{\"amount\":13.87347,\"startDate\":\"2021-02-10T18:27Z\",\"endDate\":\"2021-05-09T01:51:01Z\",\"creationDate\":\"2021-05-05T18:01:17Z\"},\"id\":\"njeputtmrywn\",\"name\":\"zoqftiyqzrnkcqvy\",\"type\":\"lwh\"},{\"properties\":{\"amount\":81.865715,\"startDate\":\"2021-07-23T19:47:42Z\",\"endDate\":\"2021-07-17T17:56:48Z\",\"creationDate\":\"2021-12-09T22:32:32Z\"},\"id\":\"oqqnwvlryav\",\"name\":\"hheunmmqhgyx\",\"type\":\"konocu\"}],\"nextLink\":\"klyaxuconu\"}") - .toObject(InstructionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstructionListResult model = new InstructionListResult(); - model = BinaryData.fromObject(model).toObject(InstructionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java deleted file mode 100644 index 53907b59c7f0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InstructionProperties; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class InstructionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InstructionProperties model = - BinaryData - .fromString( - "{\"amount\":70.4461,\"startDate\":\"2021-04-18T21:39:40Z\",\"endDate\":\"2021-05-04T00:16:05Z\",\"creationDate\":\"2021-11-21T07:12:40Z\"}") - .toObject(InstructionProperties.class); - Assertions.assertEquals(70.4461f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T21:39:40Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T00:16:05Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T07:12:40Z"), model.creationDate()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InstructionProperties model = - new InstructionProperties() - .withAmount(70.4461f) - .withStartDate(OffsetDateTime.parse("2021-04-18T21:39:40Z")) - .withEndDate(OffsetDateTime.parse("2021-05-04T00:16:05Z")) - .withCreationDate(OffsetDateTime.parse("2021-11-21T07:12:40Z")); - model = BinaryData.fromObject(model).toObject(InstructionProperties.class); - Assertions.assertEquals(70.4461f, model.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T21:39:40Z"), model.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T00:16:05Z"), model.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T07:12:40Z"), model.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java deleted file mode 100644 index 1304f5179f84..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Instruction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InstructionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"amount\":10.233182,\"startDate\":\"2021-09-29T04:01:44Z\",\"endDate\":\"2021-02-26T01:00:55Z\",\"creationDate\":\"2021-10-29T14:07:51Z\"},\"id\":\"k\",\"name\":\"crjdqnsdfzpbgtg\",\"type\":\"ylkdghrje\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Instruction response = - manager - .instructions() - .getWithResponse("rwhryvycytd", "lxgccknfnwmbtm", "pdvjdhttzaefedx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(10.233182f, response.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-29T04:01:44Z"), response.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-26T01:00:55Z"), response.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-29T14:07:51Z"), response.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java deleted file mode 100644 index 0706ffdd8508..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Instruction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InstructionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"amount\":55.698055,\"startDate\":\"2021-06-09T23:46:46Z\",\"endDate\":\"2021-07-18T03:27:54Z\",\"creationDate\":\"2020-12-23T14:53:02Z\"},\"id\":\"kkjqnvbroylaxxu\",\"name\":\"cdisd\",\"type\":\"sfjbjsvg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .instructions() - .listByBillingProfile("ckknhxkizvy", "nrzvuljraaer", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(55.698055f, response.iterator().next().amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-09T23:46:46Z"), response.iterator().next().startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-18T03:27:54Z"), response.iterator().next().endDate()); - Assertions - .assertEquals(OffsetDateTime.parse("2020-12-23T14:53:02Z"), response.iterator().next().creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java deleted file mode 100644 index 8c03ce6dab65..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InstructionsPutWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.InstructionInner; -import com.azure.resourcemanager.billing.models.Instruction; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InstructionsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"amount\":93.32798,\"startDate\":\"2021-05-04T10:42:41Z\",\"endDate\":\"2021-06-18T11:18:37Z\",\"creationDate\":\"2021-01-31T17:13:55Z\"},\"id\":\"egprhptil\",\"name\":\"ucb\",\"type\":\"qtgdqohmcwsl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Instruction response = - manager - .instructions() - .putWithResponse( - "utlwxezwzhok", - "bwnhhtql", - "ehgpp", - new InstructionInner() - .withAmount(30.197609f) - .withStartDate(OffsetDateTime.parse("2021-08-28T07:02:54Z")) - .withEndDate(OffsetDateTime.parse("2021-04-06T03:44:21Z")) - .withCreationDate(OffsetDateTime.parse("2021-01-02T20:54:57Z")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(93.32798f, response.amount()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-04T10:42:41Z"), response.startDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T11:18:37Z"), response.endDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-31T17:13:55Z"), response.creationDate()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java deleted file mode 100644 index 97de427db41d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceInner; - -public final class InvoiceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceInner model = - BinaryData - .fromString( - "{\"properties\":{\"dueDate\":\"2021-03-11T11:23:32Z\",\"invoiceDate\":\"2021-08-15T11:45:06Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"zkzivgvvcnay\",\"value\":67.249825},\"azurePrepaymentApplied\":{\"currency\":\"xxmueedn\",\"value\":33.27728},\"billedAmount\":{\"currency\":\"tkwqqtchealm\",\"value\":65.58801},\"creditAmount\":{\"currency\":\"aygdvwvgpioh\",\"value\":50.264233},\"freeAzureCreditApplied\":{\"currency\":\"fudxepxgyqagvrv\",\"value\":39.926674},\"subTotal\":{\"currency\":\"kghimdblxgwimfnj\",\"value\":1.0266364},\"taxAmount\":{\"currency\":\"mszkkfo\",\"value\":56.352932},\"totalAmount\":{\"currency\":\"kzikfjawneaivxwc\",\"value\":55.13192},\"invoicePeriodStartDate\":\"2021-05-21T02:26:51Z\",\"invoicePeriodEndDate\":\"2021-02-26T20:53:26Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"aenwabf\",\"billingProfileDisplayName\":\"kl\",\"purchaseOrderNumber\":\"xbjhwuaanozjosph\",\"documents\":[{\"kind\":\"VoidNote\",\"url\":\"rvxaglrvimjwosy\",\"source\":\"DRS\"},{\"kind\":\"CreditNote\",\"url\":\"kfcktqum\",\"source\":\"ENF\"}],\"payments\":[{\"paymentType\":\"zikhl\",\"date\":\"2021-07-20T01:18:29Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"gge\"}],\"rebillDetails\":{\"mjsjqb\":{\"creditNoteDocumentId\":\"ygaeqidbqfatpxl\",\"invoiceDocumentId\":\"xcyjmoadsuvarmy\",\"rebillDetails\":{}},\"ajxq\":{\"creditNoteDocumentId\":\"hyxxrwlycoduhpk\",\"invoiceDocumentId\":\"gymare\",\"rebillDetails\":{}},\"mnjijpxacqqudf\":{\"creditNoteDocumentId\":\"jhkycub\",\"invoiceDocumentId\":\"dgssofwqmzqal\",\"rebillDetails\":{}}},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"baaa\",\"creditForDocumentId\":\"yvayffimrzr\",\"subscriptionId\":\"zqogse\"},\"id\":\"nevfdnw\",\"name\":\"wmewzsyy\",\"type\":\"euzsoi\"}") - .toObject(InvoiceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceInner model = new InvoiceInner(); - model = BinaryData.fromObject(model).toObject(InvoiceInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java deleted file mode 100644 index 4c9b987e40d1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.InvoiceListResult; - -public final class InvoiceListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"dueDate\":\"2021-11-02T07:24:48Z\",\"invoiceDate\":\"2021-08-02T06:07:15Z\",\"status\":\"Void\",\"invoicePeriodStartDate\":\"2021-05-26T19:07:11Z\",\"invoicePeriodEndDate\":\"2021-11-15T11:38:05Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"btkuwhh\",\"billingProfileDisplayName\":\"ykojoxafnndlpic\",\"purchaseOrderNumber\":\"o\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"bpkkpwdre\",\"creditForDocumentId\":\"ovvqfovljxywsu\",\"subscriptionId\":\"yrs\"},\"id\":\"dsytgadgvr\",\"name\":\"ea\",\"type\":\"neqn\"},{\"properties\":{\"dueDate\":\"2021-06-18T06:35:15Z\",\"invoiceDate\":\"2021-01-11T09:26Z\",\"status\":\"Due\",\"invoicePeriodStartDate\":\"2021-12-01T10:12:44Z\",\"invoicePeriodEndDate\":\"2021-03-07T01:40:14Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"ji\",\"billingProfileDisplayName\":\"wifto\",\"purchaseOrderNumber\":\"kvpuvksgplsaknyn\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"huopxodlqiynto\",\"creditForDocumentId\":\"ihleos\",\"subscriptionId\":\"w\"},\"id\":\"rmslyzrpzbchckqq\",\"name\":\"qioxi\",\"type\":\"suiizynkedyat\"},{\"properties\":{\"dueDate\":\"2021-10-29T12:30:56Z\",\"invoiceDate\":\"2021-05-21T15:42:34Z\",\"status\":\"Due\",\"invoicePeriodStartDate\":\"2021-08-31T01:44:30Z\",\"invoicePeriodEndDate\":\"2021-02-06T08:02:04Z\",\"invoiceType\":\"AzureMarketplace\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"umnzgmwznmabik\",\"billingProfileDisplayName\":\"orgjhxbldt\",\"purchaseOrderNumber\":\"wrlkdmtn\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"lxdy\",\"creditForDocumentId\":\"syocogjltdtbnnha\",\"subscriptionId\":\"ocrkvcikh\"},\"id\":\"vpa\",\"name\":\"qgxqquezikyw\",\"type\":\"gxk\"}],\"nextLink\":\"la\",\"totalCount\":1870481937}") - .toObject(InvoiceListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceListResult model = new InvoiceListResult(); - model = BinaryData.fromObject(model).toObject(InvoiceListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java deleted file mode 100644 index 98c428791ddf..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceProperties; - -public final class InvoicePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceProperties model = - BinaryData - .fromString( - "{\"dueDate\":\"2021-09-06T23:25:45Z\",\"invoiceDate\":\"2021-11-18T11:14:43Z\",\"status\":\"Due\",\"amountDue\":{\"currency\":\"rthzvaytdwkqbrqu\",\"value\":67.445885},\"azurePrepaymentApplied\":{\"currency\":\"exiili\",\"value\":42.678963},\"billedAmount\":{\"currency\":\"irqtdqoa\",\"value\":4.6766224},\"creditAmount\":{\"currency\":\"fgsqu\",\"value\":38.977768},\"freeAzureCreditApplied\":{\"currency\":\"xleptramx\",\"value\":16.920918},\"subTotal\":{\"currency\":\"wnwxuqlcvyd\",\"value\":76.745186},\"taxAmount\":{\"currency\":\"ooaojkniodkooebw\",\"value\":34.47978},\"totalAmount\":{\"currency\":\"mmsbvdkcrodtjin\",\"value\":99.528564},\"invoicePeriodStartDate\":\"2021-11-16T20:55:55Z\",\"invoicePeriodEndDate\":\"2021-06-24T17:33:05Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"efkdlf\",\"billingProfileDisplayName\":\"kggkfpa\",\"purchaseOrderNumber\":\"owpulpq\",\"documents\":[{\"kind\":\"Invoice\",\"url\":\"xkqjnsjervt\",\"source\":\"DRS\"},{\"kind\":\"VoidNote\",\"url\":\"sz\",\"source\":\"ENF\"},{\"kind\":\"VoidNote\",\"url\":\"zkfzbeyv\",\"source\":\"DRS\"}],\"payments\":[{\"paymentType\":\"invkjjxdxrbuu\",\"amount\":{\"currency\":\"lewyhmlwpaz\",\"value\":41.111607},\"date\":\"2021-01-30T03:38:42Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"kwyfzqwhxxbuyqax\"},{\"paymentType\":\"eqz\",\"amount\":{\"currency\":\"riolxorjalt\",\"value\":80.87304},\"date\":\"2021-02-06T08:10:47Z\",\"paymentMethodFamily\":\"CheckWire\",\"paymentMethodType\":\"bqwcsdbnwdcf\"},{\"paymentType\":\"cqdpfuv\",\"amount\":{\"currency\":\"bjj\",\"value\":36.3222},\"date\":\"2021-05-27T00:53:27Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"vudutncor\"},{\"paymentType\":\"lxqtvcofudfl\",\"amount\":{\"currency\":\"jub\",\"value\":57.222305},\"date\":\"2021-10-26T17:09:29Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"aznqntoru\"}],\"rebillDetails\":{\"aeburuvdmo\":{\"creditNoteDocumentId\":\"a\",\"invoiceDocumentId\":\"kycgrauwj\",\"rebillDetails\":{}},\"fkifr\":{\"creditNoteDocumentId\":\"mz\",\"invoiceDocumentId\":\"wabm\",\"rebillDetails\":{}},\"ujitcjedftww\":{\"creditNoteDocumentId\":\"puqujmqlgkfbtn\",\"invoiceDocumentId\":\"aongbj\",\"rebillDetails\":{}},\"oqouicybxarzgszu\":{\"creditNoteDocumentId\":\"zkoj\",\"invoiceDocumentId\":\"c\",\"rebillDetails\":{}}},\"documentType\":\"Invoice\",\"billedDocumentId\":\"iqopidoamciod\",\"creditForDocumentId\":\"haz\",\"subscriptionId\":\"hnzbonl\"}") - .toObject(InvoiceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceProperties model = new InvoiceProperties(); - model = BinaryData.fromObject(model).toObject(InvoiceProperties.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java deleted file mode 100644 index a8b299df0c6f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionInnerTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InvoiceSectionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"awrlyx\",\"labels\":{\"nwbxgjvtbvpyssz\":\"cpr\",\"guhmuouqfpr\":\"nruj\"},\"state\":\"Restricted\",\"systemId\":\"nguitnwuizgazxu\",\"tags\":{\"hr\":\"uckyf\",\"zwdzuh\":\"idf\"},\"targetCloud\":\"USGov\"},\"id\":\"wisdkft\",\"name\":\"wxmnteiwao\",\"type\":\"vkmijcmmxdcuf\"}") - .toObject(InvoiceSectionInner.class); - Assertions.assertEquals("awrlyx", model.displayName()); - Assertions.assertEquals("cpr", model.labels().get("nwbxgjvtbvpyssz")); - Assertions.assertEquals("uckyf", model.tags().get("hr")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionInner model = - new InvoiceSectionInner() - .withDisplayName("awrlyx") - .withLabels(mapOf("nwbxgjvtbvpyssz", "cpr", "guhmuouqfpr", "nruj")) - .withTags(mapOf("hr", "uckyf", "zwdzuh", "idf")); - model = BinaryData.fromObject(model).toObject(InvoiceSectionInner.class); - Assertions.assertEquals("awrlyx", model.displayName()); - Assertions.assertEquals("cpr", model.labels().get("nwbxgjvtbvpyssz")); - Assertions.assertEquals("uckyf", model.tags().get("hr")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java deleted file mode 100644 index f97b11dd1f8b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.InvoiceSectionListResult; - -public final class InvoiceSectionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"wzbaiue\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"nyqupedeojnabck\",\"tags\":{},\"targetCloud\":\"USNat\"},\"id\":\"xpsiebtfhvpes\",\"name\":\"pskrdqmh\",\"type\":\"jdhtldwkyzxu\"},{\"properties\":{\"displayName\":\"ncwscwsvlxoto\",\"labels\":{},\"state\":\"Restricted\",\"systemId\":\"pqsxvnmicy\",\"tags\":{},\"targetCloud\":\"USSec\"},\"id\":\"o\",\"name\":\"eil\",\"type\":\"vnotyfjfcnj\"}],\"totalCount\":534363981,\"nextLink\":\"x\"}") - .toObject(InvoiceSectionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionListResult model = new InvoiceSectionListResult(); - model = BinaryData.fromObject(model).toObject(InvoiceSectionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java deleted file mode 100644 index 326974611266..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionPropertiesTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InvoiceSectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionProperties model = - BinaryData - .fromString( - "{\"displayName\":\"srp\",\"labels\":{\"sgfyccsnew\":\"idnsezcxtb\",\"oosflnr\":\"dwzjeiach\",\"vypyqrimzinpv\":\"sfqpteehz\",\"rsoodqxhcrmnoh\":\"wjdk\"},\"state\":\"Active\",\"systemId\":\"whdsoifiyip\",\"tags\":{\"rcjxvsnbyxqabn\":\"qwpgrjbzn\",\"hurzafblj\":\"ocpcy\"},\"targetCloud\":\"USGov\"}") - .toObject(InvoiceSectionProperties.class); - Assertions.assertEquals("srp", model.displayName()); - Assertions.assertEquals("idnsezcxtb", model.labels().get("sgfyccsnew")); - Assertions.assertEquals("qwpgrjbzn", model.tags().get("rcjxvsnbyxqabn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionProperties model = - new InvoiceSectionProperties() - .withDisplayName("srp") - .withLabels( - mapOf( - "sgfyccsnew", - "idnsezcxtb", - "oosflnr", - "dwzjeiach", - "vypyqrimzinpv", - "sfqpteehz", - "rsoodqxhcrmnoh", - "wjdk")) - .withTags(mapOf("rcjxvsnbyxqabn", "qwpgrjbzn", "hurzafblj", "ocpcy")); - model = BinaryData.fromObject(model).toObject(InvoiceSectionProperties.class); - Assertions.assertEquals("srp", model.displayName()); - Assertions.assertEquals("idnsezcxtb", model.labels().get("sgfyccsnew")); - Assertions.assertEquals("qwpgrjbzn", model.tags().get("rcjxvsnbyxqabn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java deleted file mode 100644 index e02362158b91..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoiceSectionsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"fqwazlnqnmcjn\",\"labels\":{\"sf\":\"dqxtbjwgnyf\"},\"state\":\"Restricted\",\"systemId\":\"uik\",\"tags\":{\"cfhmlrqryxyn\":\"jqg\",\"ptgoeiybbabp\":\"nzrdpsovwxz\"},\"targetCloud\":\"USGov\"},\"id\":\"f\",\"name\":\"lkvn\",\"type\":\"jlrigjkskyrioovz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InvoiceSection response = - manager - .invoiceSections() - .createOrUpdate( - "rtle", - "pqxbkwvzgnzvdf", - "zdix", - new InvoiceSectionInner() - .withDisplayName("pnodawopqhe") - .withLabels( - mapOf( - "bostzel", - "tmcg", - "tmzlbiojlv", - "dlat", - "r", - "hrbbpneqvcwwyy", - "nmokayzejnhlbk", - "ochpprpr")) - .withTags( - mapOf( - "chndbnwie", - "zv", - "ubwefqs", - "olewjwi", - "qtferrqwexjkmf", - "ap", - "btqwpwyawbzas", - "apjwogqqnobpudcd")), - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fqwazlnqnmcjn", response.displayName()); - Assertions.assertEquals("dqxtbjwgnyf", response.labels().get("sf")); - Assertions.assertEquals("jqg", response.tags().get("cfhmlrqryxyn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java deleted file mode 100644 index 0581a11f2959..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoiceSectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"cysihs\",\"labels\":{\"cohdx\":\"wdhohsdtmcdzsu\"},\"state\":\"Active\",\"systemId\":\"cmuapcvhd\",\"tags\":{\"qzinkfkbg\":\"wqqxeysko\"},\"targetCloud\":\"USSec\"},\"id\":\"owxeqocljmy\",\"name\":\"vkzqk\",\"type\":\"jeokbzefezrxccz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InvoiceSection response = - manager - .invoiceSections() - .getWithResponse("jtotpvopvpbd", "zq", "qqihedsvqwthmk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("cysihs", response.displayName()); - Assertions.assertEquals("wdhohsdtmcdzsu", response.labels().get("cohdx")); - Assertions.assertEquals("wqqxeysko", response.tags().get("qzinkfkbg")); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java deleted file mode 100644 index 0c7e9835ee1f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsListByBillingProfileMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.InvoiceSection; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoiceSectionsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"ehjku\",\"labels\":{\"aeylinm\":\"afgaoqlt\",\"irpghriypoqeyh\":\"gv\"},\"state\":\"Active\",\"systemId\":\"kprlpyznuc\",\"tags\":{\"xtyasiibmiyb\":\"smexiitdf\",\"mgixhcmavmqfou\":\"nustgnljh\",\"cgyypro\":\"or\"},\"targetCloud\":\"USNat\"},\"id\":\"pundmbxhug\",\"name\":\"mjkavlgorbmft\",\"type\":\"mdtzfjltfvnzc\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .invoiceSections() - .listByBillingProfile("eebtijvacvb", "qzbqqxlajrnwxa", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ehjku", response.iterator().next().displayName()); - Assertions.assertEquals("afgaoqlt", response.iterator().next().labels().get("aeylinm")); - Assertions.assertEquals("smexiitdf", response.iterator().next().tags().get("xtyasiibmiyb")); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java deleted file mode 100644 index 75be29ddfc0c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoiceSectionsOnExpandTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.InvoiceSectionInner; -import com.azure.resourcemanager.billing.models.InvoiceSectionsOnExpand; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class InvoiceSectionsOnExpandTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InvoiceSectionsOnExpand model = - BinaryData - .fromString( - "{\"hasMoreResults\":false,\"value\":[{\"properties\":{\"displayName\":\"ozwyiftyhxhuro\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"olniwpwcukjf\",\"tags\":{},\"targetCloud\":\"USNat\"},\"id\":\"w\",\"name\":\"klryplwck\",\"type\":\"asy\"},{\"properties\":{\"displayName\":\"ddhsgcbacphe\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"nqgoulzndli\",\"tags\":{},\"targetCloud\":\"USSec\"},\"id\":\"kgfg\",\"name\":\"bmadgak\",\"type\":\"qsrxybzqqed\"},{\"properties\":{\"displayName\":\"bciqfouflm\",\"labels\":{},\"state\":\"Active\",\"systemId\":\"modmglougpb\",\"tags\":{},\"targetCloud\":\"USNat\"},\"id\":\"utduqktapspwgcu\",\"name\":\"rtumkdosvq\",\"type\":\"hbmdgbbjfdd\"},{\"properties\":{\"displayName\":\"mbe\",\"labels\":{},\"state\":\"Restricted\",\"systemId\":\"tq\",\"tags\":{},\"targetCloud\":\"USGov\"},\"id\":\"fpfpsalgbquxigj\",\"name\":\"jgzjaoyfhrtx\",\"type\":\"lnerkujysvleju\"}]}") - .toObject(InvoiceSectionsOnExpand.class); - Assertions.assertEquals("ozwyiftyhxhuro", model.value().get(0).displayName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InvoiceSectionsOnExpand model = - new InvoiceSectionsOnExpand() - .withValue( - Arrays - .asList( - new InvoiceSectionInner() - .withDisplayName("ozwyiftyhxhuro") - .withLabels(mapOf()) - .withTags(mapOf()), - new InvoiceSectionInner() - .withDisplayName("ddhsgcbacphe") - .withLabels(mapOf()) - .withTags(mapOf()), - new InvoiceSectionInner() - .withDisplayName("bciqfouflm") - .withLabels(mapOf()) - .withTags(mapOf()), - new InvoiceSectionInner().withDisplayName("mbe").withLabels(mapOf()).withTags(mapOf()))); - model = BinaryData.fromObject(model).toObject(InvoiceSectionsOnExpand.class); - Assertions.assertEquals("ozwyiftyhxhuro", model.value().get(0).displayName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java deleted file mode 100644 index 89163085ad55..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadBillingSubscriptionInvoiceMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadBillingSubscriptionInvoiceMockTests { - @Test - public void testDownloadBillingSubscriptionInvoice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-05-25T20:54:06Z\",\"url\":\"knbnxwcdommpvfq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager - .invoices() - .downloadBillingSubscriptionInvoice("patlbijp", "gsksrfhf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java deleted file mode 100644 index 655048e66218..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadInvoiceMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadInvoiceMockTests { - @Test - public void testDownloadInvoice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-01-09T20:20:26Z\",\"url\":\"cbbxigdhxi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager.invoices().downloadInvoice("wjqo", "ueayfbpcmsplb", "rrueqthwmg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java deleted file mode 100644 index 7b8f4aaa50b6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingProfileInvoicesMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadMultipleBillingProfileInvoicesMockTests { - @Test - public void testDownloadMultipleBillingProfileInvoices() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-02-22T15:43:03Z\",\"url\":\"acigel\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager - .invoices() - .downloadMultipleBillingProfileInvoices( - "d", Arrays.asList("pedbwdpyqy", "bxubmdna", "cbq", "remj"), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java deleted file mode 100644 index b8e788b9f2d2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.DownloadUrl; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesDownloadMultipleBillingSubscriptionInvoicesMockTests { - @Test - public void testDownloadMultipleBillingSubscriptionInvoices() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"expiryTime\":\"2021-05-24T19:47:23Z\",\"url\":\"swmtxk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DownloadUrl response = - manager - .invoices() - .downloadMultipleBillingSubscriptionInvoices( - Arrays.asList("zfgbrttuiaclkie", "hajlfn", "hiqfyuttdiy", "b"), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java deleted file mode 100644 index d285663dbb82..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetByIdWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesGetByIdWithResponseMockTests { - @Test - public void testGetByIdWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dueDate\":\"2021-11-19T08:57:11Z\",\"invoiceDate\":\"2021-09-29T20:15:12Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"cyl\",\"value\":51.22294},\"azurePrepaymentApplied\":{\"currency\":\"sghpx\",\"value\":30.83282},\"billedAmount\":{\"currency\":\"rwjjkhvyomacluzv\",\"value\":40.415318},\"creditAmount\":{\"currency\":\"rpqpd\",\"value\":59.6452},\"freeAzureCreditApplied\":{\"currency\":\"isqcssffxuifmcs\",\"value\":69.43647},\"subTotal\":{\"currency\":\"dqzrdzsyloll\",\"value\":10.311211},\"taxAmount\":{\"currency\":\"zydmxzjijpvuaurk\",\"value\":11.588705},\"totalAmount\":{\"currency\":\"ldefxrdcoxn\",\"value\":32.83848},\"invoicePeriodStartDate\":\"2021-07-04T07:58:23Z\",\"invoicePeriodEndDate\":\"2021-04-25T04:45:39Z\",\"invoiceType\":\"AzureMarketplace\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"nqbpi\",\"billingProfileDisplayName\":\"qltgrd\",\"purchaseOrderNumber\":\"ypxrx\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"tafsrbxrblmliowx\",\"creditForDocumentId\":\"spnxwqagnepzw\",\"subscriptionId\":\"lsbs\"},\"id\":\"qqqagwwrxaomzi\",\"name\":\"glrrczez\",\"type\":\"hhltnjadhqo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Invoice response = - manager.invoices().getByIdWithResponse("xtwbta", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java deleted file mode 100644 index 5da61106e83d..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesGetBySubscriptionAndInvoiceIdWithResponseMockTests { - @Test - public void testGetBySubscriptionAndInvoiceIdWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dueDate\":\"2021-10-03T14:21:22Z\",\"invoiceDate\":\"2021-02-27T09:08:37Z\",\"status\":\"Void\",\"amountDue\":{\"currency\":\"py\",\"value\":83.36014},\"azurePrepaymentApplied\":{\"currency\":\"eblydyv\",\"value\":47.9007},\"billedAmount\":{\"currency\":\"ocxnehvsmtodl\",\"value\":57.823967},\"creditAmount\":{\"currency\":\"ucygvo\",\"value\":34.292477},\"freeAzureCreditApplied\":{\"currency\":\"ssxlghieegjlg\",\"value\":45.138866},\"subTotal\":{\"currency\":\"eksgbuxantuygd\",\"value\":8.260214},\"taxAmount\":{\"currency\":\"pirpiwrqof\",\"value\":3.015864},\"totalAmount\":{\"currency\":\"jnlex\",\"value\":70.006035},\"invoicePeriodStartDate\":\"2021-09-02T12:37:37Z\",\"invoicePeriodEndDate\":\"2021-03-18T11:37:29Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"uuuercta\",\"billingProfileDisplayName\":\"yintqpbrlcy\",\"purchaseOrderNumber\":\"uczkgofxyfsruc\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"CreditNote\",\"billedDocumentId\":\"st\",\"creditForDocumentId\":\"eaqnrmvvfkoxm\",\"subscriptionId\":\"hktuidvrma\"},\"id\":\"lpdwwexymzvlazi\",\"name\":\"bhpwvqsgnyy\",\"type\":\"uzivensrpmeyyvp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Invoice response = - manager - .invoices() - .getBySubscriptionAndInvoiceIdWithResponse("zfrgqhaohcm", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java deleted file mode 100644 index e3e1213c3c0c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"dueDate\":\"2021-03-09T19:20:38Z\",\"invoiceDate\":\"2021-03-12T02:37:11Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"efjokn\",\"value\":76.97374},\"azurePrepaymentApplied\":{\"currency\":\"qedikdfrd\",\"value\":26.596153},\"billedAmount\":{\"currency\":\"jgeihfqlggwfi\",\"value\":70.12909},\"creditAmount\":{\"currency\":\"jpbyephmgtv\",\"value\":89.511314},\"freeAzureCreditApplied\":{\"currency\":\"m\",\"value\":27.577436},\"subTotal\":{\"currency\":\"gxhnpomyqwcabv\",\"value\":19.589584},\"taxAmount\":{\"currency\":\"ey\",\"value\":95.847664},\"totalAmount\":{\"currency\":\"augmrmfjlr\",\"value\":87.45515},\"invoicePeriodStartDate\":\"2021-07-12T07:37Z\",\"invoicePeriodEndDate\":\"2021-02-10T01:38:52Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"isizm\",\"billingProfileDisplayName\":\"eds\",\"purchaseOrderNumber\":\"wuived\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"qbpsmg\",\"creditForDocumentId\":\"guamlj\",\"subscriptionId\":\"rgmsplzga\"},\"id\":\"fcshh\",\"name\":\"new\",\"type\":\"nxkympqanxrjk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Invoice response = - manager - .invoices() - .getWithResponse("ubkmifo", "xkubvphavpmhbrbq", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java deleted file mode 100644 index c42f3402475e..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingAccountMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dueDate\":\"2021-03-06T18:23Z\",\"invoiceDate\":\"2021-04-24T06:39:06Z\",\"status\":\"Paid\",\"amountDue\":{\"currency\":\"bbmpxdlvykfre\",\"value\":84.02913},\"azurePrepaymentApplied\":{\"currency\":\"qwjksghudgz\",\"value\":94.31504},\"billedAmount\":{\"currency\":\"ggsvoujkxibdaf\",\"value\":84.80425},\"creditAmount\":{\"currency\":\"yomkxfbvfbhdy\",\"value\":93.879715},\"freeAzureCreditApplied\":{\"currency\":\"pgddeimawz\",\"value\":66.26469},\"subTotal\":{\"currency\":\"um\",\"value\":96.09336},\"taxAmount\":{\"currency\":\"jcazt\",\"value\":72.1469},\"totalAmount\":{\"currency\":\"qowxwcom\",\"value\":43.389618},\"invoicePeriodStartDate\":\"2020-12-30T18:43:22Z\",\"invoicePeriodEndDate\":\"2021-05-14T17:01:32Z\",\"invoiceType\":\"AzureSupport\",\"isMonthlyInvoice\":false,\"billingProfileId\":\"k\",\"billingProfileDisplayName\":\"ve\",\"purchaseOrderNumber\":\"fdv\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"gddpq\",\"creditForDocumentId\":\"ehnmnaoyankco\",\"subscriptionId\":\"swankltytmh\"},\"id\":\"roznnhdrlktgj\",\"name\":\"sggux\",\"type\":\"eml\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .invoices() - .listByBillingAccount( - "wskondcbrwimuvqe", "osovyrrleaesin", "qtljqobbpihehc", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java deleted file mode 100644 index 147b24ce0312..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingProfileMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dueDate\":\"2020-12-27T08:21:28Z\",\"invoiceDate\":\"2021-09-25T19:32:22Z\",\"status\":\"Due\",\"amountDue\":{\"currency\":\"owx\",\"value\":91.388405},\"azurePrepaymentApplied\":{\"currency\":\"deugf\",\"value\":16.688908},\"billedAmount\":{\"currency\":\"paxwkufyk\",\"value\":29.66174},\"creditAmount\":{\"currency\":\"epmrut\",\"value\":97.59715},\"freeAzureCreditApplied\":{\"currency\":\"obns\",\"value\":77.23243},\"subTotal\":{\"currency\":\"ltymkmvguihywart\",\"value\":92.43603},\"taxAmount\":{\"currency\":\"ixkykxd\",\"value\":5.8867693},\"totalAmount\":{\"currency\":\"mmuc\",\"value\":52.700138},\"invoicePeriodStartDate\":\"2021-11-27T23:37:26Z\",\"invoicePeriodEndDate\":\"2021-02-28T12:10:12Z\",\"invoiceType\":\"AzureMarketplace\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"yincql\",\"billingProfileDisplayName\":\"isws\",\"purchaseOrderNumber\":\"iiiovgqcgxuugq\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"teqdptj\",\"creditForDocumentId\":\"dtguk\",\"subscriptionId\":\"nblwphqlkcc\"},\"id\":\"zgygqwahoiulwgni\",\"name\":\"prglvawuwzduf\",\"type\":\"pivlsbbjpm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .invoices() - .listByBillingProfile( - "ywaeeczgf", "ukklelss", "blycsxzujksr", "smdesqplpvmjcd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java deleted file mode 100644 index 349b66ca4044..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/InvoicesListByBillingSubscriptionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Invoice; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InvoicesListByBillingSubscriptionMockTests { - @Test - public void testListByBillingSubscription() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"dueDate\":\"2021-11-02T12:37:58Z\",\"invoiceDate\":\"2021-06-07T05:32:23Z\",\"status\":\"OverDue\",\"amountDue\":{\"currency\":\"eakxcptsoqfyi\",\"value\":5.842119},\"azurePrepaymentApplied\":{\"currency\":\"hkrttzrazis\",\"value\":36.422657},\"billedAmount\":{\"currency\":\"emv\",\"value\":71.442566},\"creditAmount\":{\"currency\":\"ohmn\",\"value\":47.251976},\"freeAzureCreditApplied\":{\"currency\":\"ojklin\",\"value\":55.43031},\"subTotal\":{\"currency\":\"ysprq\",\"value\":92.47625},\"taxAmount\":{\"currency\":\"ojpslsvjgpliufi\",\"value\":76.19769},\"totalAmount\":{\"currency\":\"qvapcohhoucq\",\"value\":7.474506},\"invoicePeriodStartDate\":\"2021-09-24T10:14:03Z\",\"invoicePeriodEndDate\":\"2021-03-15T00:35:26Z\",\"invoiceType\":\"AzureService\",\"isMonthlyInvoice\":true,\"billingProfileId\":\"gdzbenr\",\"billingProfileDisplayName\":\"cawetzqddt\",\"purchaseOrderNumber\":\"fljhznamtua\",\"documents\":[],\"payments\":[],\"rebillDetails\":{},\"documentType\":\"Invoice\",\"billedDocumentId\":\"tjzmi\",\"creditForDocumentId\":\"gbgatzuuvbxn\",\"subscriptionId\":\"ebwgga\"},\"id\":\"ttzlswvajqfutlx\",\"name\":\"oqza\",\"type\":\"unwqr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.invoices().listByBillingSubscription("ohdbvqvwzkj", "pwbeonr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java deleted file mode 100644 index 56546760cf4a..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"bcporxvxcjzhqizx\",\"resource\":\"xtgqscjavftjuh\",\"operation\":\"azkmtgguwp\",\"description\":\"r\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java deleted file mode 100644 index 2f44532627a6..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.OperationInner; -import com.azure.resourcemanager.billing.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"ethwwnpjhlfz\",\"isDataAction\":false,\"display\":{\"provider\":\"wahfbousnfepgfew\",\"resource\":\"wlyxgncxyk\",\"operation\":\"djhlimm\",\"description\":\"x\"}}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java deleted file mode 100644 index fa9010f7ac70..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"ihhrmo\",\"isDataAction\":false,\"display\":{\"provider\":\"eypxiutcxapzhyr\",\"resource\":\"togebjoxsl\",\"operation\":\"nhl\",\"description\":\"rqnkkzjcjbtr\"}},{\"name\":\"ehvvib\",\"isDataAction\":false,\"display\":{\"provider\":\"toqbeitpkxztmoob\",\"resource\":\"ft\",\"operation\":\"gfcwqmpimaqxzhem\",\"description\":\"h\"}},{\"name\":\"uj\",\"isDataAction\":false,\"display\":{\"provider\":\"ozzwculkba\",\"resource\":\"fajnjwltlwtjjguk\",\"operation\":\"lhsnvkcdmx\",\"description\":\"poaimlnwiaaomyl\"}}],\"nextLink\":\"azul\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java deleted file mode 100644 index 02a882f85dc7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"name\":\"umqy\",\"isDataAction\":true,\"display\":{\"provider\":\"ulodsaeuzanhsfnh\",\"resource\":\"nwph\",\"operation\":\"fngq\",\"description\":\"lidftujwjj\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java deleted file mode 100644 index 09dd454de703..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ParticipantsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Participants; - -public final class ParticipantsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Participants model = - BinaryData - .fromString("{\"status\":\"ork\",\"statusDate\":\"2021-07-22T12:33Z\",\"email\":\"wjhhgdnhxmsivf\"}") - .toObject(Participants.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Participants model = new Participants(); - model = BinaryData.fromObject(model).toObject(Participants.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java deleted file mode 100644 index 062643f36523..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PaymentPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.PaymentMethodFamily; -import com.azure.resourcemanager.billing.models.PaymentProperties; -import org.junit.jupiter.api.Assertions; - -public final class PaymentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PaymentProperties model = - BinaryData - .fromString( - "{\"paymentType\":\"tvb\",\"amount\":{\"currency\":\"sfraoyzko\",\"value\":32.20966},\"date\":\"2021-01-01T04:06:13Z\",\"paymentMethodFamily\":\"None\",\"paymentMethodType\":\"xawqaldsyuuxim\"}") - .toObject(PaymentProperties.class); - Assertions.assertEquals(PaymentMethodFamily.NONE, model.paymentMethodFamily()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PaymentProperties model = new PaymentProperties().withPaymentMethodFamily(PaymentMethodFamily.NONE); - model = BinaryData.fromObject(model).toObject(PaymentProperties.class); - Assertions.assertEquals(PaymentMethodFamily.NONE, model.paymentMethodFamily()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java deleted file mode 100644 index a556286330e9..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByBillingProfileWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.Policy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesGetByBillingProfileWithResponseMockTests { - @Test - public void testGetByBillingProfileWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"marketplacePurchases\":\"AllAllowed\",\"reservationPurchases\":\"NotAllowed\",\"viewCharges\":\"Allowed\"},\"id\":\"b\",\"name\":\"qkyojwyvf\",\"type\":\"mbtsuahxsg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Policy response = - manager - .policies() - .getByBillingProfileWithResponse("oqbvjhvefgwbmqj", "hntasfaymx", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(MarketplacePurchasesPolicy.ALL_ALLOWED, response.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, response.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java deleted file mode 100644 index 3872fd503387..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesGetByCustomerWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.CustomerPolicy; -import com.azure.resourcemanager.billing.models.ViewCharges; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesGetByCustomerWithResponseMockTests { - @Test - public void testGetByCustomerWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"viewCharges\":\"Allowed\"},\"id\":\"skbruffgllukkut\",\"name\":\"lxhrp\",\"type\":\"hvmblcouqehbhbc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomerPolicy response = - manager - .policies() - .getByCustomerWithResponse("ttxpnrupza", "mrdixtreki", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ViewCharges.ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java deleted file mode 100644 index 6d2e47ba2e62..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateCustomerWithResponseMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.CustomerPolicyInner; -import com.azure.resourcemanager.billing.models.CustomerPolicy; -import com.azure.resourcemanager.billing.models.ViewCharges; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesUpdateCustomerWithResponseMockTests { - @Test - public void testUpdateCustomerWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"viewCharges\":\"Allowed\"},\"id\":\"zyqegxyiv\",\"name\":\"inbmh\",\"type\":\"bjijkgqxnh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomerPolicy response = - manager - .policies() - .updateCustomerWithResponse( - "sziryrandoyp", - "blto", - new CustomerPolicyInner().withViewCharges(ViewCharges.ALLOWED), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ViewCharges.ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java deleted file mode 100644 index 5a2335069d8c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PoliciesUpdateWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.Policy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PoliciesUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"marketplacePurchases\":\"NotAllowed\",\"reservationPurchases\":\"Allowed\",\"viewCharges\":\"NotAllowed\"},\"id\":\"pol\",\"name\":\"t\",\"type\":\"evboclzhzjknyuxg\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Policy response = - manager - .policies() - .updateWithResponse( - "jcmmzrrscub", - "wsdrnpxqwodif", - new PolicyInner() - .withMarketplacePurchases(MarketplacePurchasesPolicy.NOT_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.NOT_ALLOWED), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(MarketplacePurchasesPolicy.NOT_ALLOWED, response.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.ALLOWED, response.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.NOT_ALLOWED, response.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java deleted file mode 100644 index 19cd4f1e5d2f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.PolicyInner; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import org.junit.jupiter.api.Assertions; - -public final class PolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"marketplacePurchases\":\"AllAllowed\",\"reservationPurchases\":\"NotAllowed\",\"viewCharges\":\"Allowed\"},\"id\":\"joqrvqqaatj\",\"name\":\"nrvgoupmfiibfgg\",\"type\":\"ioolvrwxkvtkkgll\"}") - .toObject(PolicyInner.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ALL_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PolicyInner model = - new PolicyInner() - .withMarketplacePurchases(MarketplacePurchasesPolicy.ALL_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.ALLOWED); - model = BinaryData.fromObject(model).toObject(PolicyInner.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ALL_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java deleted file mode 100644 index d0a8201e40a4..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/PolicyPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.PolicyProperties; -import com.azure.resourcemanager.billing.models.MarketplacePurchasesPolicy; -import com.azure.resourcemanager.billing.models.ReservationPurchasesPolicy; -import com.azure.resourcemanager.billing.models.ViewChargesPolicy; -import org.junit.jupiter.api.Assertions; - -public final class PolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PolicyProperties model = - BinaryData - .fromString( - "{\"marketplacePurchases\":\"OnlyFreeAllowed\",\"reservationPurchases\":\"NotAllowed\",\"viewCharges\":\"NotAllowed\"}") - .toObject(PolicyProperties.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.NOT_ALLOWED, model.viewCharges()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PolicyProperties model = - new PolicyProperties() - .withMarketplacePurchases(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED) - .withReservationPurchases(ReservationPurchasesPolicy.NOT_ALLOWED) - .withViewCharges(ViewChargesPolicy.NOT_ALLOWED); - model = BinaryData.fromObject(model).toObject(PolicyProperties.class); - Assertions.assertEquals(MarketplacePurchasesPolicy.ONLY_FREE_ALLOWED, model.marketplacePurchases()); - Assertions.assertEquals(ReservationPurchasesPolicy.NOT_ALLOWED, model.reservationPurchases()); - Assertions.assertEquals(ViewChargesPolicy.NOT_ALLOWED, model.viewCharges()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java deleted file mode 100644 index 1e1a66b9dd56..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import org.junit.jupiter.api.Assertions; - -public final class ProductInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductInner model = - BinaryData - .fromString( - "{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"vithh\",\"purchaseDate\":\"2021-10-25T20:46:01Z\",\"productTypeId\":\"osggbhc\",\"productType\":\"fwdsj\",\"status\":\"Disabled\",\"endDate\":\"2021-06-21T07:46:59Z\",\"billingFrequency\":\"Monthly\",\"lastCharge\":{\"currency\":\"swacffgdkzz\",\"value\":79.305},\"lastChargeDate\":\"2021-09-11T04:06:27Z\",\"quantity\":91.20859,\"skuId\":\"railvpnppfuf\",\"skuDescription\":\"wdmhdlxyjrxs\",\"tenantId\":\"afcnih\",\"availabilityId\":\"qapnedgfbcv\",\"invoiceSectionId\":\"vq\",\"invoiceSectionDisplayName\":\"keqdcvdrhvoods\",\"billingProfileId\":\"bobzdopcjwvnhd\",\"billingProfileDisplayName\":\"wmgxcxrsl\",\"customerId\":\"utwu\",\"customerDisplayName\":\"grpkhjwniyqs\",\"reseller\":{\"resellerId\":\"cpdggkzzlvmbmp\",\"description\":\"modfvuefywsbpfvm\"}},\"id\":\"yhrfouyftaakcpw\",\"name\":\"yzvqt\",\"type\":\"nubexk\"}") - .toObject(ProductInner.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, model.status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, model.billingFrequency()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductInner model = - new ProductInner() - .withAutoRenew(AutoRenew.OFF) - .withStatus(ProductStatusType.DISABLED) - .withBillingFrequency(BillingFrequency.MONTHLY); - model = BinaryData.fromObject(model).toObject(ProductInner.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, model.status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, model.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java deleted file mode 100644 index 7b3f18ebafa0..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ProductProperties; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import org.junit.jupiter.api.Assertions; - -public final class ProductPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductProperties model = - BinaryData - .fromString( - "{\"autoRenew\":\"Off\",\"displayName\":\"mond\",\"purchaseDate\":\"2021-04-01T23:21:50Z\",\"productTypeId\":\"xvy\",\"productType\":\"mg\",\"status\":\"Expired\",\"endDate\":\"2021-02-23T14:11:02Z\",\"billingFrequency\":\"OneTime\",\"lastCharge\":{\"currency\":\"pajqgxysm\",\"value\":44.408627},\"lastChargeDate\":\"2021-03-21T23:12:31Z\",\"quantity\":40.273422,\"skuId\":\"mkcxozapvh\",\"skuDescription\":\"xprglyatddc\",\"tenantId\":\"bcuejrjxgci\",\"availabilityId\":\"brh\",\"invoiceSectionId\":\"xsdqrhzoymibmrqy\",\"invoiceSectionDisplayName\":\"ahwfluszdtmhrk\",\"billingProfileId\":\"fyyvoq\",\"billingProfileDisplayName\":\"piexpbtgiw\",\"customerId\":\"oenwashr\",\"customerDisplayName\":\"tkcnqxwb\",\"reseller\":{\"resellerId\":\"ulpiuj\",\"description\":\"asipqiio\"}}") - .toObject(ProductProperties.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.EXPIRED, model.status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, model.billingFrequency()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductProperties model = - new ProductProperties() - .withAutoRenew(AutoRenew.OFF) - .withStatus(ProductStatusType.EXPIRED) - .withBillingFrequency(BillingFrequency.ONE_TIME); - model = BinaryData.fromObject(model).toObject(ProductProperties.class); - Assertions.assertEquals(AutoRenew.OFF, model.autoRenew()); - Assertions.assertEquals(ProductStatusType.EXPIRED, model.status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, model.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java deleted file mode 100644 index aad416840ba2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"oxoyyukp\",\"purchaseDate\":\"2021-02-08T12:14:50Z\",\"productTypeId\":\"oir\",\"productType\":\"boshbragapyyrmfs\",\"status\":\"PastDue\",\"endDate\":\"2020-12-22T03:30:36Z\",\"billingFrequency\":\"UsageBased\",\"lastCharge\":{\"currency\":\"ppdbwnupgahxkum\",\"value\":87.27331},\"lastChargeDate\":\"2021-05-10T22:23:02Z\",\"quantity\":87.1412,\"skuId\":\"dmmcpugmehqep\",\"skuDescription\":\"fhbzehewhoqhn\",\"tenantId\":\"qnbldxe\",\"availabilityId\":\"lgsc\",\"invoiceSectionId\":\"ri\",\"invoiceSectionDisplayName\":\"rsrrmoucsofldp\",\"billingProfileId\":\"iyfc\",\"billingProfileDisplayName\":\"beolh\",\"customerId\":\"lvbmxuqibsxtkcu\",\"customerDisplayName\":\"b\",\"reseller\":{\"resellerId\":\"rfsiowlkjxn\",\"description\":\"vwgf\"}},\"id\":\"tmhqykiz\",\"name\":\"d\",\"type\":\"saoafcluqvox\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .getWithResponse("ibidmhmwffp", "fmuvapckccr", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoRenew.ON, response.autoRenew()); - Assertions.assertEquals(ProductStatusType.PAST_DUE, response.status()); - Assertions.assertEquals(BillingFrequency.USAGE_BASED, response.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java deleted file mode 100644 index c49fbed294b1..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingAccountMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"gdirazf\",\"purchaseDate\":\"2021-02-11T05:39:41Z\",\"productTypeId\":\"w\",\"productType\":\"mdujtmvcopexcm\",\"status\":\"Expiring\",\"endDate\":\"2021-03-26T03:28:17Z\",\"billingFrequency\":\"Monthly\",\"lastCharge\":{\"currency\":\"yqltqsro\",\"value\":83.38941},\"lastChargeDate\":\"2020-12-26T17:33:42Z\",\"quantity\":94.9375,\"skuId\":\"jk\",\"skuDescription\":\"ysidfvclgl\",\"tenantId\":\"fuijtkbus\",\"availabilityId\":\"gsfikayiansha\",\"invoiceSectionId\":\"jtjiqx\",\"invoiceSectionDisplayName\":\"yjqtt\",\"billingProfileId\":\"kpqhjpenuygbq\",\"billingProfileDisplayName\":\"qekewvnqvcd\",\"customerId\":\"uaucmf\",\"customerDisplayName\":\"wnlaxpu\",\"reseller\":{\"resellerId\":\"ikczvvitacgxmf\",\"description\":\"serxht\"}},\"id\":\"soxhlwntsjgqr\",\"name\":\"xypruuuy\",\"type\":\"nchrszizoyu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByBillingAccount("hrtdtpdelq", "cslmotoebnfxo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.OFF, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.EXPIRING, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java deleted file mode 100644 index e62ce259b547..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByBillingProfileMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"hzjmucftbyrp\",\"purchaseDate\":\"2020-12-22T05:32:19Z\",\"productTypeId\":\"kpigqfusu\",\"productType\":\"zmkw\",\"status\":\"Disabled\",\"endDate\":\"2021-04-09T11:30:43Z\",\"billingFrequency\":\"OneTime\",\"lastCharge\":{\"currency\":\"qe\",\"value\":32.821198},\"lastChargeDate\":\"2021-08-08T18:00:09Z\",\"quantity\":15.188092,\"skuId\":\"gwydyy\",\"skuDescription\":\"svkhgbv\",\"tenantId\":\"anarfdlpukhpyrne\",\"availabilityId\":\"jcpeogkhnmg\",\"invoiceSectionId\":\"ouxddbhfhpfpazj\",\"invoiceSectionDisplayName\":\"ywjxh\",\"billingProfileId\":\"ulontacnpqwteht\",\"billingProfileDisplayName\":\"vrh\",\"customerId\":\"jyoogwxh\",\"customerDisplayName\":\"duugwbsre\",\"reseller\":{\"resellerId\":\"q\",\"description\":\"uarenlv\"}},\"id\":\"htkln\",\"name\":\"nafvvkyfedev\",\"type\":\"bo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByBillingProfile("lyetndnbfqygg", "g", "lnlg", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.ON, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java deleted file mode 100644 index c9f5b3365199..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByCustomerMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByCustomerMockTests { - @Test - public void testListByCustomer() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"ttgepuslvyjtcv\",\"purchaseDate\":\"2021-03-17T17:29:52Z\",\"productTypeId\":\"s\",\"productType\":\"iesfuug\",\"status\":\"PastDue\",\"endDate\":\"2021-02-18T13:25:08Z\",\"billingFrequency\":\"Monthly\",\"lastCharge\":{\"currency\":\"ey\",\"value\":19.2963},\"lastChargeDate\":\"2021-10-11T19:18:51Z\",\"quantity\":8.290726,\"skuId\":\"buew\",\"skuDescription\":\"s\",\"tenantId\":\"jlxuz\",\"availabilityId\":\"wpusxjbaqehg\",\"invoiceSectionId\":\"ohzjqatucoigeb\",\"invoiceSectionDisplayName\":\"cnwfepbnwgfmxjg\",\"billingProfileId\":\"bjb\",\"billingProfileDisplayName\":\"lfgtdysnaquflqbc\",\"customerId\":\"hamzjrwdkqze\",\"customerDisplayName\":\"jleziunjx\",\"reseller\":{\"resellerId\":\"antkwcegyamlbns\",\"description\":\"ac\"}},\"id\":\"jvpilguooqja\",\"name\":\"m\",\"type\":\"itgueiookjbs\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.products().listByCustomer("r", "cq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.ON, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.PAST_DUE, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.MONTHLY, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java deleted file mode 100644 index cedf6d070598..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListByInvoiceSectionMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsListByInvoiceSectionMockTests { - @Test - public void testListByInvoiceSection() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"vudb\",\"purchaseDate\":\"2021-10-09T01:41:08Z\",\"productTypeId\":\"tvq\",\"productType\":\"rqctmxxdtdd\",\"status\":\"Cancelled\",\"endDate\":\"2021-05-15T03:50:17Z\",\"billingFrequency\":\"OneTime\",\"lastCharge\":{\"currency\":\"vtzn\",\"value\":64.74098},\"lastChargeDate\":\"2021-11-27T23:17:15Z\",\"quantity\":21.243965,\"skuId\":\"vvoxczytprwnw\",\"skuDescription\":\"oevytlyokr\",\"tenantId\":\"o\",\"availabilityId\":\"xv\",\"invoiceSectionId\":\"asbcrymodizrx\",\"invoiceSectionDisplayName\":\"obdxnazpmkmlm\",\"billingProfileId\":\"vfxzopjh\",\"billingProfileDisplayName\":\"xliohrdddt\",\"customerId\":\"xqbawpc\",\"customerDisplayName\":\"nzqcy\",\"reseller\":{\"resellerId\":\"p\",\"description\":\"fyuicdh\"}},\"id\":\"bd\",\"name\":\"bwwg\",\"type\":\"d\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .products() - .listByInvoiceSection("lcqxypokk", "minqcym", "zng", "bdxxe", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoRenew.OFF, response.iterator().next().autoRenew()); - Assertions.assertEquals(ProductStatusType.CANCELLED, response.iterator().next().status()); - Assertions.assertEquals(BillingFrequency.ONE_TIME, response.iterator().next().billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java deleted file mode 100644 index 8aef8638de8f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ProductsListResult; - -public final class ProductsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProductsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"rn\",\"purchaseDate\":\"2021-01-14T16:52:07Z\",\"productTypeId\":\"q\",\"productType\":\"hxcr\",\"status\":\"PastDue\",\"endDate\":\"2021-11-28T02:47:56Z\",\"billingFrequency\":\"OneTime\",\"lastChargeDate\":\"2021-03-25T00:29:47Z\",\"quantity\":52.194805,\"skuId\":\"hsqfsubcgjbirxbp\",\"skuDescription\":\"srfbjfdtwss\",\"tenantId\":\"ftpvjzbexil\",\"availabilityId\":\"nfqqnvwp\",\"invoiceSectionId\":\"taruoujmkcj\",\"invoiceSectionDisplayName\":\"qytjrybnwjewgd\",\"billingProfileId\":\"ervnaenqpehi\",\"billingProfileDisplayName\":\"oygmift\",\"customerId\":\"zdnds\",\"customerDisplayName\":\"nayqi\"},\"id\":\"nduhavhqlkthum\",\"name\":\"qolbgyc\",\"type\":\"uie\"},{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"y\",\"purchaseDate\":\"2021-01-19T22:33:55Z\",\"productTypeId\":\"l\",\"productType\":\"slqlfmmdn\",\"status\":\"Expired\",\"endDate\":\"2021-10-21T18:49:25Z\",\"billingFrequency\":\"Monthly\",\"lastChargeDate\":\"2021-11-30T08:30:44Z\",\"quantity\":76.70319,\"skuId\":\"wyhzdx\",\"skuDescription\":\"adbzmnvdfznud\",\"tenantId\":\"dvxzbncblylpst\",\"availabilityId\":\"hh\",\"invoiceSectionId\":\"rzdzucerscdnt\",\"invoiceSectionDisplayName\":\"vfiwjmygtdss\",\"billingProfileId\":\"wtmwerio\",\"billingProfileDisplayName\":\"pyqs\",\"customerId\":\"wab\",\"customerDisplayName\":\"tshhszhedp\"},\"id\":\"wiwubm\",\"name\":\"mbes\",\"type\":\"dnkwwtppjflcxog\"},{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"z\",\"purchaseDate\":\"2021-05-06T06:04:09Z\",\"productTypeId\":\"kvmkqzeqq\",\"productType\":\"l\",\"status\":\"Expired\",\"endDate\":\"2021-06-11T23:31:33Z\",\"billingFrequency\":\"OneTime\",\"lastChargeDate\":\"2021-01-04T21:57:35Z\",\"quantity\":1.5751779,\"skuId\":\"odkwobd\",\"skuDescription\":\"xtibqdxbxwakbog\",\"tenantId\":\"ndlkzgxhurip\",\"availabilityId\":\"podxunkb\",\"invoiceSectionId\":\"xmubyyntwlrbq\",\"invoiceSectionDisplayName\":\"oievseotgqrlltm\",\"billingProfileId\":\"lauwzizxbmpgcjef\",\"billingProfileDisplayName\":\"muvp\",\"customerId\":\"tdum\",\"customerDisplayName\":\"p\"},\"id\":\"ebmnzbtbhjpglk\",\"name\":\"gohdneuelfphsd\",\"type\":\"htozfikdow\"}],\"totalCount\":1185627072,\"nextLink\":\"v\"}") - .toObject(ProductsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProductsListResult model = new ProductsListResult(); - model = BinaryData.fromObject(model).toObject(ProductsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java deleted file mode 100644 index 802a72a859fa..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsMoveWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsMoveWithResponseMockTests { - @Test - public void testMoveWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRenew\":\"On\",\"displayName\":\"xfzzzwyjafitlhgu\",\"purchaseDate\":\"2021-06-17T12:18:01Z\",\"productTypeId\":\"hlgmltxdwhmoz\",\"productType\":\"gzvlnsnn\",\"status\":\"Cancelled\",\"endDate\":\"2021-07-24T17:46:18Z\",\"billingFrequency\":\"UsageBased\",\"lastCharge\":{\"currency\":\"mwamxqzragpgdph\",\"value\":77.4531},\"lastChargeDate\":\"2021-04-17T05:54:10Z\",\"quantity\":30.930174,\"skuId\":\"lejchcsr\",\"skuDescription\":\"knmzlanrupdwvnp\",\"tenantId\":\"nzqtpjhmqrhvt\",\"availabilityId\":\"aiwdcxsmlzzhz\",\"invoiceSectionId\":\"xetlgydlhqv\",\"invoiceSectionDisplayName\":\"npxybafiq\",\"billingProfileId\":\"aarbgjekg\",\"billingProfileDisplayName\":\"lbyulidwcwvmze\",\"customerId\":\"o\",\"customerDisplayName\":\"hj\",\"reseller\":{\"resellerId\":\"gdn\",\"description\":\"brfkspz\"}},\"id\":\"zmtksjci\",\"name\":\"digsxcdgl\",\"type\":\"plkeuachtomflryt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .moveWithResponse( - "vhqjwtrhtgvg", - "pcrrk", - new TransferProductRequestProperties().withDestinationInvoiceSectionId("awjmjsmw"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoRenew.ON, response.autoRenew()); - Assertions.assertEquals(ProductStatusType.CANCELLED, response.status()); - Assertions.assertEquals(BillingFrequency.USAGE_BASED, response.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java deleted file mode 100644 index f374a04deaf2..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ProductsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.fluent.models.ProductInner; -import com.azure.resourcemanager.billing.models.AutoRenew; -import com.azure.resourcemanager.billing.models.BillingFrequency; -import com.azure.resourcemanager.billing.models.Product; -import com.azure.resourcemanager.billing.models.ProductStatusType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ProductsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoRenew\":\"Off\",\"displayName\":\"etgbebjfulb\",\"purchaseDate\":\"2021-02-08T00:52:50Z\",\"productTypeId\":\"h\",\"productType\":\"pnfpubntnbat\",\"status\":\"Disabled\",\"endDate\":\"2021-05-10T12:36:54Z\",\"billingFrequency\":\"UsageBased\",\"lastCharge\":{\"currency\":\"aelcat\",\"value\":6.264615},\"lastChargeDate\":\"2021-05-25T09:31:16Z\",\"quantity\":37.74234,\"skuId\":\"vkmjcwmjvlgf\",\"skuDescription\":\"cvkyylizrzbj\",\"tenantId\":\"fxsfuztlvtmv\",\"availabilityId\":\"bwidql\",\"invoiceSectionId\":\"ukoveofi\",\"invoiceSectionDisplayName\":\"vjfn\",\"billingProfileId\":\"mvl\",\"billingProfileDisplayName\":\"z\",\"customerId\":\"blkujrllfojuidjp\",\"customerDisplayName\":\"yjucejikzoeo\",\"reseller\":{\"resellerId\":\"zejet\",\"description\":\"ln\"}},\"id\":\"ikyju\",\"name\":\"k\",\"type\":\"bqzolxr\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Product response = - manager - .products() - .updateWithResponse( - "ycjimryvwgcwwpbm", - "gwe", - new ProductInner() - .withAutoRenew(AutoRenew.OFF) - .withStatus(ProductStatusType.CANCELLED) - .withBillingFrequency(BillingFrequency.ONE_TIME), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoRenew.OFF, response.autoRenew()); - Assertions.assertEquals(ProductStatusType.DISABLED, response.status()); - Assertions.assertEquals(BillingFrequency.USAGE_BASED, response.billingFrequency()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java deleted file mode 100644 index af86288f701c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/RebillDetailsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.RebillDetails; - -public final class RebillDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RebillDetails model = - BinaryData - .fromString( - "{\"creditNoteDocumentId\":\"qfobwyz\",\"invoiceDocumentId\":\"bykutw\",\"rebillDetails\":{\"akgtdlmkkzevdlh\":{\"creditNoteDocumentId\":\"a\",\"invoiceDocumentId\":\"hrskdsnfd\",\"rebillDetails\":{}},\"akufgmjz\":{\"creditNoteDocumentId\":\"pusdstt\",\"invoiceDocumentId\":\"ogvbbejdcngq\",\"rebillDetails\":{}}}}") - .toObject(RebillDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RebillDetails model = new RebillDetails(); - model = BinaryData.fromObject(model).toObject(RebillDetails.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java deleted file mode 100644 index 4a0330b58b17..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ResellerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.Reseller; - -public final class ResellerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Reseller model = - BinaryData - .fromString("{\"resellerId\":\"gsxnkjzkdeslpv\",\"description\":\"pwiyig\"}") - .toObject(Reseller.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Reseller model = new Reseller(); - model = BinaryData.fromObject(model).toObject(Reseller.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java deleted file mode 100644 index fdc06de7fa02..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ReservationInner; -import com.azure.resourcemanager.billing.models.ReservationSkuProperty; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationInner model = - BinaryData - .fromString( - "{\"id\":\"vdwxfzwi\",\"name\":\"wzjbh\",\"type\":\"sxjrk\",\"location\":\"btrnegvm\",\"sku\":{\"name\":\"q\"},\"properties\":{\"appliedScopes\":[\"dspastjbkkdmfl\"],\"appliedScopeType\":\"stmjlxrri\",\"reservedResourceType\":\"zapeewchpx\",\"quantity\":51.30364,\"provisioningState\":\"kuziycsle\",\"expiryDate\":\"f\",\"provisioningSubState\":\"tcktyhjtqedcgzu\",\"displayName\":\"mmrqz\",\"displayProvisioningState\":\"rjvpglydzgkrvqee\",\"userFriendlyRenewState\":\"oepry\",\"userFriendlyAppliedScopeType\":\"nwy\",\"effectiveDateTime\":\"zdmovzv\",\"skuDescription\":\"aawzqadfl\",\"term\":\"ur\",\"renew\":true,\"renewSource\":\"ecxn\",\"utilization\":{\"trend\":\"cokpv\",\"aggregates\":[]}}}") - .toObject(ReservationInner.class); - Assertions.assertEquals("dspastjbkkdmfl", model.appliedScopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationInner model = - new ReservationInner() - .withSku(new ReservationSkuProperty()) - .withAppliedScopes(Arrays.asList("dspastjbkkdmfl")); - model = BinaryData.fromObject(model).toObject(ReservationInner.class); - Assertions.assertEquals("dspastjbkkdmfl", model.appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java deleted file mode 100644 index c40bb2b085f5..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.ReservationProperty; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ReservationPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationProperty model = - BinaryData - .fromString( - "{\"appliedScopes\":[\"gxobfirclnp\",\"ciayzriykhya\",\"fvjlboxqvkjlmx\"],\"appliedScopeType\":\"mdy\",\"reservedResourceType\":\"dwdigumb\",\"quantity\":79.26031,\"provisioningState\":\"uzzptjazysdz\",\"expiryDate\":\"zwwva\",\"provisioningSubState\":\"yuvvfonkp\",\"displayName\":\"qyikvy\",\"displayProvisioningState\":\"uyav\",\"userFriendlyRenewState\":\"wmn\",\"userFriendlyAppliedScopeType\":\"ttijfybvpoekrs\",\"effectiveDateTime\":\"gbdhuzqgnjdg\",\"skuDescription\":\"nscliqhzvhxnk\",\"term\":\"tkubotppn\",\"renew\":false,\"renewSource\":\"xhihfrbbcevqagtl\",\"utilization\":{\"trend\":\"lfkqojpy\",\"aggregates\":[{\"grain\":71.06859,\"grainUnit\":\"cnifm\",\"value\":42.886497,\"valueUnit\":\"ymbrnysuxmpraf\"}]}}") - .toObject(ReservationProperty.class); - Assertions.assertEquals("gxobfirclnp", model.appliedScopes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationProperty model = - new ReservationProperty().withAppliedScopes(Arrays.asList("gxobfirclnp", "ciayzriykhya", "fvjlboxqvkjlmx")); - model = BinaryData.fromObject(model).toObject(ReservationProperty.class); - Assertions.assertEquals("gxobfirclnp", model.appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java deleted file mode 100644 index cfdbbf018576..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationPropertyUtilizationTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationPropertyUtilization; -import com.azure.resourcemanager.billing.models.ReservationUtilizationAggregates; -import java.util.Arrays; - -public final class ReservationPropertyUtilizationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationPropertyUtilization model = - BinaryData - .fromString( - "{\"trend\":\"ckh\",\"aggregates\":[{\"grain\":5.347806,\"grainUnit\":\"ffwafq\",\"value\":61.13735,\"valueUnit\":\"aspavehhr\"}]}") - .toObject(ReservationPropertyUtilization.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationPropertyUtilization model = - new ReservationPropertyUtilization().withAggregates(Arrays.asList(new ReservationUtilizationAggregates())); - model = BinaryData.fromObject(model).toObject(ReservationPropertyUtilization.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java deleted file mode 100644 index 8eb47537dc76..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSkuPropertyTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationSkuProperty; - -public final class ReservationSkuPropertyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationSkuProperty model = BinaryData.fromString("{\"name\":\"t\"}").toObject(ReservationSkuProperty.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSkuProperty model = new ReservationSkuProperty(); - model = BinaryData.fromObject(model).toObject(ReservationSkuProperty.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java deleted file mode 100644 index fed07fadee2c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationSummaryTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationSummary; - -public final class ReservationSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationSummary model = - BinaryData - .fromString( - "{\"succeededCount\":29.918415,\"failedCount\":93.61522,\"expiringCount\":44.341938,\"expiredCount\":23.334568,\"pendingCount\":75.85746,\"cancelledCount\":61.311485}") - .toObject(ReservationSummary.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationSummary model = new ReservationSummary(); - model = BinaryData.fromObject(model).toObject(ReservationSummary.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java deleted file mode 100644 index ed0430403c36..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationUtilizationAggregatesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationUtilizationAggregates; - -public final class ReservationUtilizationAggregatesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationUtilizationAggregates model = - BinaryData - .fromString("{\"grain\":55.157936,\"grainUnit\":\"n\",\"value\":42.470722,\"valueUnit\":\"dhcxgkmoy\"}") - .toObject(ReservationUtilizationAggregates.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationUtilizationAggregates model = new ReservationUtilizationAggregates(); - model = BinaryData.fromObject(model).toObject(ReservationUtilizationAggregates.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java deleted file mode 100644 index dc7a22dea93f..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingAccountMockTests.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Reservation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReservationsListByBillingAccountMockTests { - @Test - public void testListByBillingAccount() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"wpwerye\",\"name\":\"kdhmeottawjyosx\",\"type\":\"hnhjtfvpndpmi\",\"location\":\"pnwy\",\"sku\":{\"name\":\"qllzsauzpjlxeehu\"},\"properties\":{\"appliedScopes\":[\"zlrayme\",\"xls\",\"ihmxrfdsajredn\",\"yyshtuwgmevua\"],\"appliedScopeType\":\"wzyif\",\"reservedResourceType\":\"gwltxeqip\",\"quantity\":21.367962,\"provisioningState\":\"yimsfayorpr\",\"expiryDate\":\"kj\",\"provisioningSubState\":\"eslabnsmjkwynq\",\"displayName\":\"ekqsykvwjtqpkev\",\"displayProvisioningState\":\"ltjcrspxk\",\"userFriendlyRenewState\":\"r\",\"userFriendlyAppliedScopeType\":\"lfg\",\"effectiveDateTime\":\"nnnoytz\",\"skuDescription\":\"sewxigpxvkqm\",\"term\":\"pxvpifdfaif\",\"renew\":true,\"renewSource\":\"eyuubei\",\"utilization\":{\"trend\":\"l\",\"aggregates\":[]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .reservations() - .listByBillingAccount( - "yqwixvcpwnkwywzw", - "falickduoiqtamty", - "sknxrwzawnvsbcf", - "zagxnvhycvdi", - "wrzregzgyufu", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zlrayme", response.iterator().next().appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java deleted file mode 100644 index c4c6e8631ae3..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListByBillingProfileMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.Reservation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ReservationsListByBillingProfileMockTests { - @Test - public void testListByBillingProfile() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"dnaienhqhskndnel\",\"name\":\"aadl\",\"type\":\"wf\",\"location\":\"nniyopetxi\",\"sku\":{\"name\":\"rl\"},\"properties\":{\"appliedScopes\":[\"caephbl\"],\"appliedScopeType\":\"qp\",\"reservedResourceType\":\"vbqsdt\",\"quantity\":63.41683,\"provisioningState\":\"tvivuzqym\",\"expiryDate\":\"owog\",\"provisioningSubState\":\"it\",\"displayName\":\"hzvb\",\"displayProvisioningState\":\"cdb\",\"userFriendlyRenewState\":\"fzndscxmxeatkd\",\"userFriendlyAppliedScopeType\":\"wnrdjyibqbnaom\",\"effectiveDateTime\":\"rmkuh\",\"skuDescription\":\"xljalfihc\",\"term\":\"obcancdexxqcw\",\"renew\":false,\"renewSource\":\"gvaknokzwjjzrl\",\"utilization\":{\"trend\":\"l\",\"aggregates\":[]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .reservations() - .listByBillingProfile( - "toi", - "hgygvfltgvd", - "hoynk", - "xwetwkdrcyrucpc", - "nn", - "zdqumoe", - com.azure.core.util.Context.NONE); - - Assertions.assertEquals("caephbl", response.iterator().next().appliedScopes().get(0)); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java deleted file mode 100644 index 04fa82034225..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/ReservationsListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.ReservationSummary; -import com.azure.resourcemanager.billing.models.ReservationsListResult; - -public final class ReservationsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ReservationsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"id\":\"ox\",\"name\":\"dufiq\",\"type\":\"ieuzaofjchvcyyy\",\"location\":\"gdotcubiipuipwo\",\"sku\":{\"name\":\"macjekn\"},\"properties\":{\"appliedScopes\":[],\"appliedScopeType\":\"qvci\",\"reservedResourceType\":\"ev\",\"quantity\":66.675064,\"provisioningState\":\"lrri\",\"expiryDate\":\"ywdxsmic\",\"provisioningSubState\":\"rwfscjfnynszquj\",\"displayName\":\"dvoqyt\",\"displayProvisioningState\":\"yo\",\"userFriendlyRenewState\":\"blgyavutpthj\",\"userFriendlyAppliedScopeType\":\"oismsksbpimlqol\",\"effectiveDateTime\":\"kcgxxlxsffgcvi\",\"skuDescription\":\"zdwlvwlyoupfgfb\",\"term\":\"ubdyhgk\",\"renew\":false,\"renewSource\":\"sgow\"}},{\"id\":\"tsttktlahbq\",\"name\":\"tx\",\"type\":\"zukxitmmqtgqq\",\"location\":\"hrnxrxc\",\"sku\":{\"name\":\"isavok\"},\"properties\":{\"appliedScopes\":[],\"appliedScopeType\":\"vazivjlfr\",\"reservedResourceType\":\"tbajlkatn\",\"quantity\":27.220089,\"provisioningState\":\"opidkqqfkuv\",\"expiryDate\":\"xkdmligo\",\"provisioningSubState\":\"brxk\",\"displayName\":\"loazuruocbgoo\",\"displayProvisioningState\":\"te\",\"userFriendlyRenewState\":\"bfhjxakvvjgsl\",\"userFriendlyAppliedScopeType\":\"dilmyww\",\"effectiveDateTime\":\"gkxnyedabg\",\"skuDescription\":\"udtjuewbc\",\"term\":\"xuuwhcj\",\"renew\":false,\"renewSource\":\"ybvpay\"}},{\"id\":\"udzpxgwjplmagstc\",\"name\":\"hpfkyrkdbdgi\",\"type\":\"sjkmnwqj\",\"location\":\"baiyhddviaceg\",\"sku\":{\"name\":\"ntfpmvmemfnc\"},\"properties\":{\"appliedScopes\":[],\"appliedScopeType\":\"vbalxlllc\",\"reservedResourceType\":\"odbzevwrdnhf\",\"quantity\":22.404224,\"provisioningState\":\"sjcswsmystuluqyp\",\"expiryDate\":\"vlerchpqbmfpjba\",\"provisioningSubState\":\"idfcxsspuunnoxyh\",\"displayName\":\"g\",\"displayProvisioningState\":\"drihpfhoqcaaewda\",\"userFriendlyRenewState\":\"djvlpj\",\"userFriendlyAppliedScopeType\":\"kzbrmsgeivsiy\",\"effectiveDateTime\":\"kdncj\",\"skuDescription\":\"onbzoggculapzwy\",\"term\":\"gogtqxepnylbf\",\"renew\":true,\"renewSource\":\"yjt\"}}],\"nextLink\":\"fqzhv\",\"summary\":{\"succeededCount\":53.406746,\"failedCount\":13.140678,\"expiringCount\":70.9251,\"expiredCount\":36.47178,\"pendingCount\":75.72936,\"cancelledCount\":24.269749}}") - .toObject(ReservationsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ReservationsListResult model = new ReservationsListResult().withSummary(new ReservationSummary()); - model = BinaryData.fromObject(model).toObject(ReservationsListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java deleted file mode 100644 index 7afc61e4e0fd..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionInnerTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.TransactionInner; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import org.junit.jupiter.api.Assertions; - -public final class TransactionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransactionInner model = - BinaryData - .fromString( - "{\"properties\":{\"kind\":\"reservation\",\"date\":\"2021-02-11T03:05:15Z\",\"invoice\":\"vfgbvfvpdboda\",\"invoiceId\":\"zsjqlh\",\"orderId\":\"r\",\"orderName\":\"deibqip\",\"productFamily\":\"ghvxndzwmkrefa\",\"productTypeId\":\"jorwkqnyhgbij\",\"productType\":\"ivfxzsjabibsyst\",\"productDescription\":\"fsdjpvkvp\",\"transactionType\":\"Usage" - + " Charge\",\"transactionAmount\":{\"currency\":\"zbzkdvncjabudurg\",\"value\":26.81675},\"quantity\":133724472,\"invoiceSectionId\":\"zhjjklffhmouwq\",\"invoiceSectionDisplayName\":\"zrfze\",\"billingProfileId\":\"ebizikayuh\",\"billingProfileDisplayName\":\"bjbsybb\",\"customerId\":\"r\",\"customerDisplayName\":\"ldgmfpgvmpip\",\"subscriptionId\":\"ltha\",\"subscriptionName\":\"x\",\"azurePlan\":\"mwutwbdsre\",\"azureCreditApplied\":{\"currency\":\"rhneuyowq\",\"value\":14.874917},\"billingCurrency\":\"t\",\"discount\":8.667755,\"effectivePrice\":{\"currency\":\"rcgp\",\"value\":82.618744},\"exchangeRate\":48.570366,\"marketPrice\":{\"currency\":\"j\",\"value\":71.50711},\"pricingCurrency\":\"fzxiavrmb\",\"servicePeriodStartDate\":\"2021-09-13T10:29:44Z\",\"servicePeriodEndDate\":\"2021-09-04T02:46:50Z\",\"subTotal\":{\"currency\":\"rjqc\",\"value\":39.849525},\"tax\":{\"currency\":\"frl\",\"value\":33.48236},\"unitOfMeasure\":\"rnwoiindfp\",\"units\":71.931244,\"unitType\":\"lwbtlhf\"},\"id\":\"sj\",\"name\":\"dhszfjv\",\"type\":\"bgofeljag\"}") - .toObject(TransactionInner.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransactionInner model = - new TransactionInner() - .withKind(TransactionTypeKind.RESERVATION) - .withTransactionType(ReservationType.USAGE_CHARGE); - model = BinaryData.fromObject(model).toObject(TransactionInner.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java deleted file mode 100644 index 08865890d0ee..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.TransactionListResult; - -public final class TransactionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransactionListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"kind\":\"all\",\"date\":\"2021-11-17T05:10:44Z\",\"invoice\":\"l\",\"invoiceId\":\"qhoftrmaequiah\",\"orderId\":\"cslfaoqzpiyylha\",\"orderName\":\"swhccsphk\",\"productFamily\":\"vwitqscyw\",\"productTypeId\":\"gwol\",\"productType\":\"czbwemhairsbr\",\"productDescription\":\"dwmsweypqwd\",\"transactionType\":\"Usage" - + " Charge\",\"quantity\":98596504,\"invoiceSectionId\":\"n\",\"invoiceSectionDisplayName\":\"huexmk\",\"billingProfileId\":\"lstvlzywe\",\"billingProfileDisplayName\":\"zrncsdt\",\"customerId\":\"u\",\"customerDisplayName\":\"ypbsfgytguslfead\",\"subscriptionId\":\"gq\",\"subscriptionName\":\"yhejhzisxgfp\",\"azurePlan\":\"olppvksrpqvujz\",\"billingCurrency\":\"htwdwrftswibyrcd\",\"discount\":4.1148844,\"exchangeRate\":62.17856,\"pricingCurrency\":\"racstwity\",\"servicePeriodStartDate\":\"2021-10-09T17:15:47Z\",\"servicePeriodEndDate\":\"2021-11-26T04:46:53Z\",\"unitOfMeasure\":\"dcpnmdyodnw\",\"units\":98.19005,\"unitType\":\"jc\"},\"id\":\"nhltiugcxn\",\"name\":\"vvwxqi\",\"type\":\"y\"}],\"totalCount\":1643458041,\"nextLink\":\"owx\"}") - .toObject(TransactionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransactionListResult model = new TransactionListResult(); - model = BinaryData.fromObject(model).toObject(TransactionListResult.class); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java deleted file mode 100644 index c18ba9efdace..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionPropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.fluent.models.TransactionProperties; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import org.junit.jupiter.api.Assertions; - -public final class TransactionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransactionProperties model = - BinaryData - .fromString( - "{\"kind\":\"reservation\",\"date\":\"2021-11-19T13:43:04Z\",\"invoice\":\"dvriiiojnal\",\"invoiceId\":\"fk\",\"orderId\":\"vsexsowuelu\",\"orderName\":\"hahhxvrhmzkwpj\",\"productFamily\":\"wspughftqsxhqx\",\"productTypeId\":\"xukndxdigr\",\"productType\":\"uufzdmsyqtfihw\",\"productDescription\":\"otzi\",\"transactionType\":\"Usage" - + " Charge\",\"transactionAmount\":{\"currency\":\"pph\",\"value\":41.082405},\"quantity\":1174017685,\"invoiceSectionId\":\"dphqamv\",\"invoiceSectionDisplayName\":\"fwynwcvtbvkay\",\"billingProfileId\":\"tnvyqiatkzwp\",\"billingProfileDisplayName\":\"p\",\"customerId\":\"cjaesgvvs\",\"customerDisplayName\":\"yajguqfhwygzlv\",\"subscriptionId\":\"kfxu\",\"subscriptionName\":\"mdwzrmuhapfcqdps\",\"azurePlan\":\"qvpsvuoymg\",\"azureCreditApplied\":{\"currency\":\"lvez\",\"value\":37.44613},\"billingCurrency\":\"lmfeokerq\",\"discount\":19.447208,\"effectivePrice\":{\"currency\":\"ob\",\"value\":38.23564},\"exchangeRate\":82.422646,\"marketPrice\":{\"currency\":\"owepbqpcrfkb\",\"value\":99.00544},\"pricingCurrency\":\"njv\",\"servicePeriodStartDate\":\"2020-12-20T11:43:27Z\",\"servicePeriodEndDate\":\"2021-06-07T08:17:55Z\",\"subTotal\":{\"currency\":\"ekftnkhtj\",\"value\":1.9628167},\"tax\":{\"currency\":\"wfqatmtd\",\"value\":20.163143},\"unitOfMeasure\":\"vypgikdg\",\"units\":99.876915,\"unitType\":\"kbir\"}") - .toObject(TransactionProperties.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransactionProperties model = - new TransactionProperties() - .withKind(TransactionTypeKind.RESERVATION) - .withTransactionType(ReservationType.USAGE_CHARGE); - model = BinaryData.fromObject(model).toObject(TransactionProperties.class); - Assertions.assertEquals(TransactionTypeKind.RESERVATION, model.kind()); - Assertions.assertEquals(ReservationType.USAGE_CHARGE, model.transactionType()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java deleted file mode 100644 index f0d7396d584b..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransactionsListByInvoiceMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.billing.BillingManager; -import com.azure.resourcemanager.billing.models.ReservationType; -import com.azure.resourcemanager.billing.models.Transaction; -import com.azure.resourcemanager.billing.models.TransactionTypeKind; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TransactionsListByInvoiceMockTests { - @Test - public void testListByInvoice() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"kind\":\"reservation\",\"date\":\"2021-10-25T06:31:18Z\",\"invoice\":\"vne\",\"invoiceId\":\"aifghtmoqqt\",\"orderId\":\"fhzbkr\",\"orderName\":\"jjavfq\",\"productFamily\":\"hnqoewdo\",\"productTypeId\":\"yetesy\",\"productType\":\"idbz\",\"productDescription\":\"hqtfbovn\",\"transactionType\":\"Purchase\",\"transactionAmount\":{\"currency\":\"etnjuhpsprkz\",\"value\":20.758957},\"quantity\":333927859,\"invoiceSectionId\":\"ccxnafbwqroohtuo\",\"invoiceSectionDisplayName\":\"aonurjtumg\",\"billingProfileId\":\"hpv\",\"billingProfileDisplayName\":\"mslclblyjxlt\",\"customerId\":\"juscvsfx\",\"customerDisplayName\":\"ctmgxuupbezqccy\",\"subscriptionId\":\"tce\",\"subscriptionName\":\"d\",\"azurePlan\":\"ky\",\"azureCreditApplied\":{\"currency\":\"tg\",\"value\":65.07157},\"billingCurrency\":\"qzgwldoychil\",\"discount\":47.130497,\"effectivePrice\":{\"currency\":\"ehuwaoa\",\"value\":0.38245916},\"exchangeRate\":37.166195,\"marketPrice\":{\"currency\":\"lizst\",\"value\":20.003922},\"pricingCurrency\":\"vhrweftkwqejpmv\",\"servicePeriodStartDate\":\"2021-09-05T09:38:44Z\",\"servicePeriodEndDate\":\"2021-06-10T02:31:17Z\",\"subTotal\":{\"currency\":\"wamcxtczhup\",\"value\":59.264435},\"tax\":{\"currency\":\"jduyyespydjfb\",\"value\":9.652024},\"unitOfMeasure\":\"hhulrtywikdm\",\"units\":94.05045,\"unitType\":\"uflgbhgauacdixm\"},\"id\":\"ufr\",\"name\":\"ryjqgdkf\",\"type\":\"ozo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - BillingManager manager = - BillingManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.transactions().listByInvoice("ctwwgzw", "jlmec", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(TransactionTypeKind.RESERVATION, response.iterator().next().kind()); - Assertions.assertEquals(ReservationType.PURCHASE, response.iterator().next().transactionType()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java deleted file mode 100644 index d25251d3efc7..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferBillingSubscriptionRequestPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.TransferBillingSubscriptionRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class TransferBillingSubscriptionRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransferBillingSubscriptionRequestProperties model = - BinaryData - .fromString("{\"destinationInvoiceSectionId\":\"u\"}") - .toObject(TransferBillingSubscriptionRequestProperties.class); - Assertions.assertEquals("u", model.destinationInvoiceSectionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransferBillingSubscriptionRequestProperties model = - new TransferBillingSubscriptionRequestProperties().withDestinationInvoiceSectionId("u"); - model = BinaryData.fromObject(model).toObject(TransferBillingSubscriptionRequestProperties.class); - Assertions.assertEquals("u", model.destinationInvoiceSectionId()); - } -} diff --git a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java b/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java deleted file mode 100644 index b1fac5e65b2c..000000000000 --- a/sdk/billing/azure-resourcemanager-billing/src/test/java/com/azure/resourcemanager/billing/generated/TransferProductRequestPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.billing.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.billing.models.TransferProductRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class TransferProductRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TransferProductRequestProperties model = - BinaryData - .fromString("{\"destinationInvoiceSectionId\":\"rfdwoyu\"}") - .toObject(TransferProductRequestProperties.class); - Assertions.assertEquals("rfdwoyu", model.destinationInvoiceSectionId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TransferProductRequestProperties model = - new TransferProductRequestProperties().withDestinationInvoiceSectionId("rfdwoyu"); - model = BinaryData.fromObject(model).toObject(TransferProductRequestProperties.class); - Assertions.assertEquals("rfdwoyu", model.destinationInvoiceSectionId()); - } -}