Skip to content

Commit

Permalink
Update test region FR (#42901)
Browse files Browse the repository at this point in the history
  • Loading branch information
samvaity authored Nov 20, 2024
1 parent 76fb215 commit 70ea8ee
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
"sdk/keyvault/test-resources/test-resources.json",
"sdk/keyvault/test-resources-jca/test-resources.json",
"sdk/formrecognizer/azure-ai-formrecognizer/**",
"sdk/formrecognizer/test-resources.json",
"sdk/documentintelligence/azure-ai-documentintelligence/**",
"sdk/documentintelligence/test-resources.json",
"sdk/maps/azure-maps-render/**",
Expand Down
4 changes: 4 additions & 0 deletions sdk/documentintelligence/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
"type": "string",
"defaultValue": "trainingdata-batch"
},
"batchTrainingDataResultContainer": {
"type": "string",
"defaultValue": "trainingdata-batch-result"
},
"selectionMarkTrainingDataContainer": {
"type": "string",
"defaultValue": "selectionmark-v3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,11 @@ private static void setDocumentFieldValue(
DocumentFieldHelper.setValue(documentField, null);
} else {
CurrencyValue currencyValue = new CurrencyValue();
CurrencyValueHelper.setAmount(currencyValue, innerDocumentField.getValueCurrency().getAmount());
CurrencyValueHelper.setCurrencySymbol(currencyValue,
innerDocumentField.getValueCurrency().getCurrencySymbol());
com.azure.ai.formrecognizer.documentanalysis.implementation.models.CurrencyValue innerCurrencyValue
= innerDocumentField.getValueCurrency();
CurrencyValueHelper.setAmount(currencyValue, innerCurrencyValue.getAmount());
CurrencyValueHelper.setCurrencySymbol(currencyValue, innerCurrencyValue.getCurrencySymbol());
CurrencyValueHelper.setCode(currencyValue, innerCurrencyValue.getCurrencyCode());
DocumentFieldHelper.setValue(documentField, currencyValue);
}
} else if (com.azure.ai.formrecognizer.documentanalysis.implementation.models.DocumentFieldType.ADDRESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
import com.azure.ai.formrecognizer.documentanalysis.administration.models.DocumentClassifierDetails;
import com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeDocumentOptions;
import com.azure.ai.formrecognizer.documentanalysis.models.AnalyzeResult;
import com.azure.ai.formrecognizer.documentanalysis.models.CurrencyValue;
import com.azure.ai.formrecognizer.documentanalysis.models.DocumentAnalysisFeature;
import com.azure.ai.formrecognizer.documentanalysis.models.DocumentBarcode;
import com.azure.ai.formrecognizer.documentanalysis.models.DocumentBarcodeKind;
import com.azure.ai.formrecognizer.documentanalysis.models.DocumentField;
import com.azure.ai.formrecognizer.documentanalysis.models.DocumentFormula;
import com.azure.ai.formrecognizer.documentanalysis.models.DocumentFormulaKind;
import com.azure.ai.formrecognizer.documentanalysis.models.DocumentStyle;
Expand Down Expand Up @@ -993,6 +995,11 @@ public void analyzeInvoiceWithPage(HttpClient httpClient, DocumentAnalysisServic

AnalyzeResult analyzeResult = syncPoller.getFinalResult();
Assertions.assertEquals(1, analyzeResult.getPages().size());
Map<String, DocumentField> invoicePage1Fields = analyzeResult.getDocuments().get(0).getFields();
CurrencyValue invoiceTotalField = invoicePage1Fields.get("InvoiceTotal").getValueAsCurrency();
assertEquals(56651.49, invoiceTotalField.getAmount());
assertEquals("$", invoiceTotalField.getSymbol());
assertEquals("USD", invoiceTotalField.getCode());
}, INVOICE_PDF);
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/formrecognizer/test-resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"blobStorageAccount": {
"type": "string",
"defaultValue": "azuresdktrainingdata"
"defaultValue": "azuresdktrainingdatatme"
},
"trainingDataContainerV3": {
"type": "string",
Expand All @@ -48,7 +48,7 @@
},
"blobResourceId": {
"type": "string",
"defaultValue": "[resourceId(subscription().subscriptionId, 'TrainingData', 'Microsoft.Storage/storageAccounts', parameters('blobStorageAccount'))]"
"defaultValue": "[resourceId('4d042dc6-fe17-4698-a23f-ec6a8d1e98f4', 'static-test-resources', 'Microsoft.Storage/storageAccounts', parameters('blobStorageAccount'))]"
},
"trainingDataSasPropertiesV3": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion sdk/formrecognizer/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ extends:
safeName: azureaiformrecognizer
CloudConfig:
Public:
Location: 'centraluseuap'
Location: 'eastus'

0 comments on commit 70ea8ee

Please sign in to comment.