Skip to content

Commit

Permalink
[TA] Fix live tests (#35296)
Browse files Browse the repository at this point in the history
  • Loading branch information
mssfang authored Jun 5, 2023
1 parent 3c019d1 commit b17e7e7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 40 deletions.
2 changes: 1 addition & 1 deletion sdk/textanalytics/azure-ai-textanalytics/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/textanalytics/azure-ai-textanalytics",
"Tag": "java/textanalytics/azure-ai-textanalytics_3369166513"
"Tag": "java/textanalytics/azure-ai-textanalytics_71462656f7"
}
Original file line number Diff line number Diff line change
Expand Up @@ -834,67 +834,46 @@ static AnalyzeHealthcareEntitiesResult getRecognizeHealthcareEntitiesResult1(Str
HealthcareEntityPropertiesHelper.setDataSources(healthcareEntity2,
IterableStream.of(null));
final HealthcareEntity healthcareEntity3 = new HealthcareEntity();
HealthcareEntityPropertiesHelper.setText(healthcareEntity3, "progressive");
HealthcareEntityPropertiesHelper.setCategory(healthcareEntity3, HealthcareEntityCategory.fromString("Course"));
HealthcareEntityPropertiesHelper.setText(healthcareEntity3, "progressive angina");
HealthcareEntityPropertiesHelper.setNormalizedText(healthcareEntity3, "Progressive Angina");
HealthcareEntityPropertiesHelper.setCategory(healthcareEntity3, HealthcareEntityCategory.DIAGNOSIS);
HealthcareEntityPropertiesHelper.setConfidenceScore(healthcareEntity3, 0.91);
HealthcareEntityPropertiesHelper.setOffset(healthcareEntity3, 57);
HealthcareEntityPropertiesHelper.setLength(healthcareEntity3, 11);
HealthcareEntityPropertiesHelper.setLength(healthcareEntity3, 18);
HealthcareEntityPropertiesHelper.setDataSources(healthcareEntity3,
IterableStream.of(null));
final HealthcareEntity healthcareEntity4 = new HealthcareEntity();
HealthcareEntityPropertiesHelper.setText(healthcareEntity4, "angina");
HealthcareEntityPropertiesHelper.setNormalizedText(healthcareEntity4, "Angina Pectoris");
HealthcareEntityPropertiesHelper.setCategory(healthcareEntity4, HealthcareEntityCategory.SYMPTOM_OR_SIGN);
HealthcareEntityPropertiesHelper.setConfidenceScore(healthcareEntity4, 0.81);
HealthcareEntityPropertiesHelper.setOffset(healthcareEntity4, 69);
HealthcareEntityPropertiesHelper.setLength(healthcareEntity4, 6);
HealthcareEntityPropertiesHelper.setText(healthcareEntity4, "past several months");
HealthcareEntityPropertiesHelper.setCategory(healthcareEntity4, HealthcareEntityCategory.TIME);
HealthcareEntityPropertiesHelper.setConfidenceScore(healthcareEntity4, 1.0);
HealthcareEntityPropertiesHelper.setOffset(healthcareEntity4, 85);
HealthcareEntityPropertiesHelper.setLength(healthcareEntity4, 19);
HealthcareEntityPropertiesHelper.setDataSources(healthcareEntity4,
IterableStream.of(null));
// there are too many healthcare entity data sources, we can just assert it is not null.
HealthcareEntityPropertiesHelper.setDataSources(healthcareEntity4,
IterableStream.of(null));
final HealthcareEntity healthcareEntity5 = new HealthcareEntity();
HealthcareEntityPropertiesHelper.setText(healthcareEntity5, "past several months");
HealthcareEntityPropertiesHelper.setCategory(healthcareEntity5, HealthcareEntityCategory.TIME);
HealthcareEntityPropertiesHelper.setConfidenceScore(healthcareEntity5, 1.0);
HealthcareEntityPropertiesHelper.setOffset(healthcareEntity5, 85);
HealthcareEntityPropertiesHelper.setLength(healthcareEntity5, 19);
HealthcareEntityPropertiesHelper.setDataSources(healthcareEntity5,
IterableStream.of(null));

// RecognizeHealthcareEntitiesResult
final AnalyzeHealthcareEntitiesResult healthcareEntitiesResult1 = new AnalyzeHealthcareEntitiesResult(documentId,
textDocumentStatistics1, null);
AnalyzeHealthcareEntitiesResultPropertiesHelper.setEntities(healthcareEntitiesResult1,
new IterableStream<>(asList(healthcareEntity1, healthcareEntity2, healthcareEntity3, healthcareEntity4,
healthcareEntity5)));
new IterableStream<>(asList(healthcareEntity1, healthcareEntity2, healthcareEntity3, healthcareEntity4)));

// HealthcareEntityRelations
final HealthcareEntityRelation healthcareEntityRelation1 = new HealthcareEntityRelation();
final HealthcareEntityRelationRole role1 = new HealthcareEntityRelationRole();
HealthcareEntityRelationRolePropertiesHelper.setName(role1, "Course");
HealthcareEntityRelationRolePropertiesHelper.setName(role1, "Condition");
HealthcareEntityRelationRolePropertiesHelper.setEntity(role1, healthcareEntity3);
final HealthcareEntityRelationRole role2 = new HealthcareEntityRelationRole();
HealthcareEntityRelationRolePropertiesHelper.setName(role2, "Condition");
HealthcareEntityRelationRolePropertiesHelper.setEntity(role2, healthcareEntity4);
HealthcareEntityRelationPropertiesHelper.setRelationType(healthcareEntityRelation1,
HealthcareEntityRelationType.fromString("CourseOfCondition"));
HealthcareEntityRelationPropertiesHelper.setRoles(healthcareEntityRelation1,
IterableStream.of(asList(role1, role2)));
HealthcareEntityRelationPropertiesHelper.setConfidenceScore(healthcareEntityRelation1, 1.0);

final HealthcareEntityRelation healthcareEntityRelation2 = new HealthcareEntityRelation();
final HealthcareEntityRelationRole role3 = new HealthcareEntityRelationRole();
HealthcareEntityRelationRolePropertiesHelper.setName(role3, "Time");
HealthcareEntityRelationRolePropertiesHelper.setEntity(role3, healthcareEntity5);
final HealthcareEntityRelationRole role2 = new HealthcareEntityRelationRole();
HealthcareEntityRelationRolePropertiesHelper.setName(role2, "Time");
HealthcareEntityRelationRolePropertiesHelper.setEntity(role2, healthcareEntity4);
HealthcareEntityRelationPropertiesHelper.setRelationType(healthcareEntityRelation2,
HealthcareEntityRelationType.TIME_OF_CONDITION);
HealthcareEntityRelationPropertiesHelper.setRoles(healthcareEntityRelation2,
IterableStream.of(asList(role2, role3)));
IterableStream.of(asList(role1, role2)));
HealthcareEntityRelationPropertiesHelper.setConfidenceScore(healthcareEntityRelation2, 1.0);

AnalyzeHealthcareEntitiesResultPropertiesHelper.setEntityRelations(healthcareEntitiesResult1,
IterableStream.of(asList(healthcareEntityRelation1, healthcareEntityRelation2)));
IterableStream.of(asList(healthcareEntityRelation2)));
return healthcareEntitiesResult1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1850,7 +1850,6 @@ public void healthcareStringInputWithOptions(HttpClient httpClient, TextAnalytic
analyzeHealthcareEntitiesPagedFlux.toStream().collect(Collectors.toList()));
});
}

@ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
@MethodSource("com.azure.ai.textanalytics.TestUtils#getTestParameters")
public void healthcareMaxOverload(HttpClient httpClient, TextAnalyticsServiceVersion serviceVersion) {
Expand All @@ -1875,7 +1874,6 @@ public void healthcareMaxOverload(HttpClient httpClient, TextAnalyticsServiceVer
analyzeHealthcareEntitiesPagedFlux.toStream().collect(Collectors.toList()));
});
}

@ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS)
@MethodSource("com.azure.ai.textanalytics.TestUtils#getTestParameters")
public void healthcareLroPagination(HttpClient httpClient, TextAnalyticsServiceVersion serviceVersion) {
Expand Down

0 comments on commit b17e7e7

Please sign in to comment.