Skip to content

Commit b2cd14a

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 9b78632 commit b2cd14a

File tree

3 files changed

+10
-27
lines changed

3 files changed

+10
-27
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/inference/ModelTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ public String modelId() {
122122
}
123123

124124
public static List<NamedWriteableRegistry.Entry> getNamedWriteables() {
125-
return List.of(
126-
new NamedWriteableRegistry.Entry(ServiceSettings.class, TestServiceSettings.NAME, TestServiceSettings::new)
127-
);
125+
return List.of(new NamedWriteableRegistry.Entry(ServiceSettings.class, TestServiceSettings.NAME, TestServiceSettings::new));
128126
}
129127
}

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/inference/results/ModelStoreResponseTests.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ public void testFailed() {
3838
assertTrue(failedResponse.failed());
3939
}
4040
{
41-
var failedResponse = new ModelStoreResponse(
42-
"model_2",
43-
RestStatus.OK,
44-
new IllegalStateException("Test failure")
45-
);
41+
var failedResponse = new ModelStoreResponse("model_2", RestStatus.OK, new IllegalStateException("Test failure"));
4642
assertTrue(failedResponse.failed());
4743
}
4844
}
@@ -70,12 +66,11 @@ protected ModelStoreResponse mutateInstance(ModelStoreResponse instance) throws
7066
String newInferenceId = instance.inferenceId() + "_mutated";
7167
yield new ModelStoreResponse(newInferenceId, instance.status(), instance.failureCause());
7268
}
73-
case 1 ->
74-
new ModelStoreResponse(
75-
instance.inferenceId(),
76-
randomValueOtherThan(instance.status(), () -> randomFrom(RestStatus.values())),
77-
instance.failureCause()
78-
);
69+
case 1 -> new ModelStoreResponse(
70+
instance.inferenceId(),
71+
randomValueOtherThan(instance.status(), () -> randomFrom(RestStatus.values())),
72+
instance.failureCause()
73+
);
7974
case 2 -> {
8075
Exception newFailureCause = instance.failureCause() == null ? new IllegalStateException("Mutated exception") : null;
8176
yield new ModelStoreResponse(instance.inferenceId(), instance.status(), newFailureCause);

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/elastic/authorization/PreconfiguredEndpointModelAdapterTests.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ public void testGetModelsWithValidId() {
6464
DEFAULT_RERANK_ENDPOINT_ID_V1,
6565
DEFAULT_MULTILINGUAL_EMBED_ENDPOINT_ID
6666
);
67-
var models = PreconfiguredEndpointModelAdapter.getModels(
68-
endpointIds,
69-
EIS_COMPONENTS
70-
);
67+
var models = PreconfiguredEndpointModelAdapter.getModels(endpointIds, EIS_COMPONENTS);
7168

7269
assertThat(models, hasSize(endpointIds.size()));
7370
assertThat(
@@ -127,11 +124,7 @@ public void testGetModelsWithValidId() {
127124

128125
public void testGetModelsWithValidAndInvalidIds() {
129126
var models = PreconfiguredEndpointModelAdapter.getModels(
130-
Set.of(
131-
DEFAULT_CHAT_COMPLETION_ENDPOINT_ID_V1,
132-
"some-invalid-id",
133-
DEFAULT_ELSER_ENDPOINT_ID_V2
134-
),
127+
Set.of(DEFAULT_CHAT_COMPLETION_ENDPOINT_ID_V1, "some-invalid-id", DEFAULT_ELSER_ENDPOINT_ID_V2),
135128
EIS_COMPONENTS
136129
);
137130

@@ -168,9 +161,6 @@ public void testGetModelsWithValidAndInvalidIds() {
168161
}
169162

170163
public void testGetModelsWithOnlyInvalidId() {
171-
assertThat(PreconfiguredEndpointModelAdapter.getModels(
172-
Collections.singleton("nonexistent-id"),
173-
EIS_COMPONENTS
174-
), is(List.of()));
164+
assertThat(PreconfiguredEndpointModelAdapter.getModels(Collections.singleton("nonexistent-id"), EIS_COMPONENTS), is(List.of()));
175165
}
176166
}

0 commit comments

Comments
 (0)