Skip to content

Commit

Permalink
fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Oct 5, 2023
1 parent 843b05f commit 795da0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ public static ElserMlNodeServiceSettings fromMap(Map<String, Object> map) {
}

String version = MapParsingUtils.removeAsType(map, MODEL_VERSION, String.class);
if (version != null && VALID_ELSER_MODELS.contains(version) == false) {
validationException.addValidationError("unknown ELSER model version [" + version + "]");
if (version != null) {
if (VALID_ELSER_MODELS.contains(version) == false) {
validationException.addValidationError("unknown ELSER model version [" + version + "]");
}
} else {
version = ElserMlNodeService.ELSER_V2_MODEL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void testFromMap() {
1,
ElserMlNodeServiceSettings.NUM_THREADS,
4,
"model_version",
ElserMlNodeServiceSettings.MODEL_VERSION,
".elser_model_1"
)
)
Expand All @@ -66,7 +66,7 @@ public void testFromMapInvalidVersion() {
)
)
);
assertThat(e.getMessage(), containsString("faeafa"));
assertThat(e.getMessage(), containsString("unknown ELSER model version [.elser_model_27]"));
}

public void testFromMapMissingOptions() {
Expand Down

0 comments on commit 795da0e

Please sign in to comment.