Skip to content

Commit a6a854d

Browse files
Remove already covered test method and related helper function from LlamaServiceTests
1 parent ed7d4e0 commit a6a854d

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/llama/LlamaServiceTests.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
import static org.elasticsearch.xpack.inference.services.ServiceComponentsTests.createWithEmptySettings;
9090
import static org.elasticsearch.xpack.inference.services.llama.completion.LlamaChatCompletionModelTests.createChatCompletionModel;
9191
import static org.elasticsearch.xpack.inference.services.llama.completion.LlamaChatCompletionServiceSettingsTests.getServiceSettingsMap;
92-
import static org.elasticsearch.xpack.inference.services.llama.embeddings.LlamaEmbeddingsServiceSettingsTests.buildServiceSettingsMap;
9392
import static org.elasticsearch.xpack.inference.services.settings.DefaultSecretSettingsTests.getSecretSettingsMap;
9493
import static org.hamcrest.CoreMatchers.is;
9594
import static org.hamcrest.Matchers.equalTo;
@@ -627,28 +626,6 @@ public void testSupportsStreaming() throws IOException {
627626
}
628627
}
629628

630-
public void testParseRequestConfig_ThrowsWhenAnExtraKeyExistsInEmbeddingSecretSettingsMap() throws IOException {
631-
try (var service = createService()) {
632-
var secretSettings = getSecretSettingsMap("secret");
633-
secretSettings.put("extra_key", "value");
634-
635-
var config = getRequestConfigMap(getEmbeddingsServiceSettingsMap(), secretSettings);
636-
637-
ActionListener<Model> modelVerificationListener = ActionListener.wrap(
638-
model -> fail("Expected exception, but got model: " + model),
639-
exception -> {
640-
assertThat(exception, instanceOf(ElasticsearchStatusException.class));
641-
assertThat(
642-
exception.getMessage(),
643-
is("Configuration contains settings [{extra_key=value}] unknown to the [llama] service")
644-
);
645-
}
646-
);
647-
648-
service.parseRequestConfig("id", TaskType.TEXT_EMBEDDING, config, modelVerificationListener);
649-
}
650-
}
651-
652629
public void testChunkedInfer_ChunkingSettingsNotSet() throws IOException {
653630
var model = LlamaEmbeddingsModelTests.createEmbeddingsModel("id", "url", "api_key", "user", null, false);
654631
model.setURI(getUrl(webServer));
@@ -858,8 +835,4 @@ private Map<String, Object> getRequestConfigMap(Map<String, Object> serviceSetti
858835

859836
return new HashMap<>(Map.of(ModelConfigurations.SERVICE_SETTINGS, builtServiceSettings));
860837
}
861-
862-
private static Map<String, Object> getEmbeddingsServiceSettingsMap() {
863-
return buildServiceSettingsMap("id", "url", SimilarityMeasure.COSINE.toString(), null, null, null, null);
864-
}
865838
}

0 commit comments

Comments
 (0)