Skip to content

Commit 0c8cbcd

Browse files
committed
SNAPSHOT - Revert copilot suggestions
1 parent 35ad613 commit 0c8cbcd

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/RerouteProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public final class RerouteProcessor extends AbstractProcessor {
9090
public IngestDocument execute(IngestDocument ingestDocument) throws Exception {
9191
if (destination != null) {
9292
ProjectMetadata projectMetadata = clusterService.state().projectState(projectId).metadata();
93-
streamsPermissionsUtils.throwIfRetrouteToSubstreamNotAllowed(projectMetadata, ingestDocument.getIndexHistory(), destination);
93+
streamsPermissionsUtils.throwIfRerouteToSubstreamNotAllowed(projectMetadata, ingestDocument.getIndexHistory(), destination);
9494
ingestDocument.reroute(destination);
9595
return ingestDocument;
9696
}

modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/RerouteProcessorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void setUpStreamsPermissionsUtils() {
4545
.putProjectMetadata(ProjectMetadata.builder(ProjectId.DEFAULT).build())
4646
.build();
4747
when(clusterServiceMock.state()).thenReturn(clusterState);
48-
doNothing().when(streamsPermissionsUtilsMock).throwIfRetrouteToSubstreamNotAllowed(any(), any(), anyString());
48+
doNothing().when(streamsPermissionsUtilsMock).throwIfRerouteToSubstreamNotAllowed(any(), any(), anyString());
4949
}
5050

5151
public void testDefaults() throws Exception {

server/src/test/java/org/elasticsearch/action/bulk/BulkOperationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public class BulkOperationTests extends ESTestCase {
251251
private TestThreadPool threadPool;
252252

253253
private StreamsPermissionsUtils streamsPermissionsUtilsMock;
254-
// Removed the unused projectResolverMock field.
254+
private ProjectResolver projectResolverMock;
255255
private IndexNameExpressionResolver indexNameExpressionResolverMock;
256256

257257
@Before

server/src/test/java/org/elasticsearch/common/streams/StreamsPermissionsUtilsTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,41 +66,41 @@ public void testIfRetrouteToSubstreamNotAllowedThrows() {
6666

6767
IllegalArgumentException ex = expectThrows(
6868
IllegalArgumentException.class,
69-
() -> utils.throwIfRetrouteToSubstreamNotAllowed(projectMetadataMock, indexHistory, destination)
69+
() -> utils.throwIfRerouteToSubstreamNotAllowed(projectMetadataMock, indexHistory, destination)
7070
);
7171

7272
assertTrue(ex.getMessage().contains("Cannot reroute to substream"));
7373
assertTrue(ex.getMessage().contains(destination));
7474
}
7575

76-
public void testThrowIfRetrouteToSubstreamNotAllowedDoesNotThrowWhenStreamTypeDisabled() {
76+
public void testthrowIfRerouteToSubstreamNotAllowedDoesNotThrowWhenStreamTypeDisabled() {
7777
when(streamsMetadataMock.isLogsEnabled()).thenReturn(false);
7878

7979
Set<String> indexHistory = Collections.emptySet();
8080
String destination = StreamType.LOGS.getStreamName() + ".substream";
8181

8282
// Should not throw since stream type is disabled
83-
utils.throwIfRetrouteToSubstreamNotAllowed(projectMetadataMock, indexHistory, destination);
83+
utils.throwIfRerouteToSubstreamNotAllowed(projectMetadataMock, indexHistory, destination);
8484
}
8585

86-
public void testThrowIfRetrouteToSubstreamNotAllowedDoesNotThrowWhenDestinationNotSubstream() {
86+
public void testthrowIfRerouteToSubstreamNotAllowedDoesNotThrowWhenDestinationNotSubstream() {
8787
when(streamsMetadataMock.isLogsEnabled()).thenReturn(true);
8888

8989
Set<String> indexHistory = Collections.emptySet();
9090
String destination = StreamType.LOGS.getStreamName(); // not a substream
9191

9292
// Should not throw since destination is not a substream
93-
utils.throwIfRetrouteToSubstreamNotAllowed(projectMetadataMock, indexHistory, destination);
93+
utils.throwIfRerouteToSubstreamNotAllowed(projectMetadataMock, indexHistory, destination);
9494
}
9595

96-
public void testThrowIfRetrouteToSubstreamNotAllowedDoesNotThrowWhenIndexHistoryContainsStream() {
96+
public void testthrowIfRerouteToSubstreamNotAllowedDoesNotThrowWhenIndexHistoryContainsStream() {
9797
when(streamsMetadataMock.isLogsEnabled()).thenReturn(true);
9898

9999
Set<String> indexHistory = new HashSet<>();
100100
indexHistory.add(StreamType.LOGS.getStreamName());
101101
String destination = StreamType.LOGS.getStreamName() + ".substream";
102102

103103
// Should not throw since indexHistory contains the stream name
104-
utils.throwIfRetrouteToSubstreamNotAllowed(projectMetadataMock, indexHistory, destination);
104+
utils.throwIfRerouteToSubstreamNotAllowed(projectMetadataMock, indexHistory, destination);
105105
}
106106
}

0 commit comments

Comments
 (0)