Source:
<code>public void checkRecognizedFormTypeLabeledModel( HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { final FormTrainingClient formTrainingClient = getFormTrainingClient(httpClient, serviceVersion); dataRunner((data, dataLength) -> { beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<FormRecognizerOperationResult, CustomFormModel> syncPoller = formTrainingClient.beginTraining(trainingFilesUrl, useTrainingLabels, new TrainingOptions().setPollInterval(durationTestMode), Context.NONE); syncPoller.waitForCompletion(); CustomFormModel createdModel = syncPoller.getFinalResult(); FormRecognizerClient formRecognizerClient = getFormTrainingClient(httpClient, serviceVersion) .getFormRecognizerClient(); SyncPoller<FormRecognizerOperationResult, List<RecognizedForm>> syncPoller1 = formRecognizerClient.beginRecognizeCustomForms( createdModel.getModelId(), data, dataLength, new RecognizeCustomFormsOptions() .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode), Context.NONE); syncPoller1.waitForCompletion(); final RecognizedForm recognizedForm = syncPoller1.getFinalResult().stream().findFirst().get(); assertEquals("custom:" + createdModel.getModelId(), recognizedForm.getFormType()); assertNotNull(recognizedForm.getFormTypeConfidence()); final CustomFormSubmodel submodel = createdModel.getSubmodels().get(0); assertEquals("custom:" + createdModel.getModelId(), submodel.getFormType()); formTrainingClient.deleteModel(createdModel.getModelId()); <START> formTrainingClient.deleteModel(createdModel.getModelId()); <END> }); }, FORM_JPG); }</code><technical_language>calling delete model</technical_language>

Target:
public void checkRecognizedFormTypeLabeledModel( HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { final FormTrainingClient formTrainingClient = getFormTrainingClient(httpClient, serviceVersion); dataRunner((data, dataLength) -> { beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<FormRecognizerOperationResult, CustomFormModel> syncPoller = formTrainingClient.beginTraining(trainingFilesUrl, useTrainingLabels, new TrainingOptions().setPollInterval(durationTestMode), Context.NONE); syncPoller.waitForCompletion(); CustomFormModel createdModel = syncPoller.getFinalResult(); FormRecognizerClient formRecognizerClient = getFormTrainingClient(httpClient, serviceVersion) .getFormRecognizerClient(); SyncPoller<FormRecognizerOperationResult, List<RecognizedForm>> syncPoller1 = formRecognizerClient.beginRecognizeCustomForms( createdModel.getModelId(), data, dataLength, new RecognizeCustomFormsOptions() .setContentType(FormContentType.IMAGE_JPEG).setPollInterval(durationTestMode), Context.NONE); syncPoller1.waitForCompletion(); final RecognizedForm recognizedForm = syncPoller1.getFinalResult().stream().findFirst().get(); assertEquals("custom:" + createdModel.getModelId(), recognizedForm.getFormType()); assertNotNull(recognizedForm.getFormTypeConfidence()); final CustomFormSubmodel submodel = createdModel.getSubmodels().get(0); assertEquals("custom:" + createdModel.getModelId(), submodel.getFormType()); formTrainingClient.deleteModel(createdModel.getModelId()); }); }, FORM_JPG); }