Skip to content

Commit c6cb4ba

Browse files
committed
Test error
1 parent 04354cc commit c6cb4ba

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

x-pack/plugin/slm/src/internalClusterTest/java/org/elasticsearch/xpack/slm/SLMFileSettingsIT.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,7 @@ public void clusterChanged(ClusterChangedEvent event) {
285285
if (reservedState != null && reservedState.errorMetadata() != null) {
286286
assertEquals(ReservedStateErrorMetadata.ErrorKind.VALIDATION, reservedState.errorMetadata().errorKind());
287287
assertThat(reservedState.errorMetadata().errors(), allOf(notNullValue(), hasSize(1)));
288-
assertThat(
289-
reservedState.errorMetadata().errors().get(0),
290-
containsString("no such repository [other-repo] in project [default]")
291-
);
288+
assertThat(reservedState.errorMetadata().errors().get(0), containsString("no such repository [other-repo]"));
292289
clusterService.removeListener(this);
293290
metadataVersion.set(event.state().metadata().version());
294291
savedClusterState.countDown();
@@ -332,7 +329,7 @@ private void assertClusterStateNotSaved(CountDownLatch savedClusterState, Atomic
332329
// This will fail because repo-new isn't there, not because we can't write test-snapshots-err, meaning we were allowed to
333330
// make the request
334331
assertEquals(
335-
"no such repository [repo-new] in project [default]",
332+
"no such repository [repo-new]",
336333
expectThrows(
337334
IllegalArgumentException.class,
338335
() -> client().execute(PutSnapshotLifecycleAction.INSTANCE, sampleRestRequest("test-snapshots-err")).actionGet()

x-pack/plugin/slm/src/main/java/org/elasticsearch/xpack/slm/SnapshotLifecycleService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ private SnapshotLifecycleProjectState getOrCreateProjectState(ProjectId projectI
264264
*/
265265
public static void validateRepositoryExists(final ProjectMetadata projectMetadata, final String repository) {
266266
if (RepositoriesMetadata.get(projectMetadata).repository(repository) == null) {
267-
throw new IllegalArgumentException("no such repository [" + repository + "] in project [" + projectMetadata.id() + "]");
267+
throw new IllegalArgumentException("no such repository [" + repository + "]");
268268
}
269269
}
270270

0 commit comments

Comments
 (0)