Fix 0 case terminology cache test (intermittent test failure)

This commit is contained in:
dotasek 2022-05-05 14:40:32 -04:00
parent 7a7e3240b4
commit cc6ee9216c
1 changed files with 4 additions and 2 deletions

View File

@ -426,8 +426,10 @@ public class TerminologyCacheTests {
String extracted = cache.extracted(json, vs);
JsonElement element = jsonParser.parse(extracted);
assertEquals(max, element.getAsJsonObject().getAsJsonObject("expansion").getAsJsonArray("contains").size());
final int expansionSize = element.getAsJsonObject().has("expansion")
? element.getAsJsonObject().getAsJsonObject("expansion").getAsJsonArray("contains").size()
: 0;
assertEquals(max, expansionSize);
}
@ParameterizedTest