Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ import org.opensearch.core.common.io.stream.Writeable
/**
* Transport action plugin interfaces for the cross-cluster-replication plugin.
*/
open class ReplicationPluginInterface {

object ReplicationPluginInterface {
/**
* Stop replication.
* @param client Node client for making transport action
* @param request The request object
* @param listener The listener for getting response
*/

open fun stopReplication(
fun stopReplication(
client: Client,
request: StopIndexReplicationRequest,
listener: ActionListener<AcknowledgedResponse>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ internal class ReplicationPluginInterfaceTests {
actionListener.onResponse(acknowledgedResponse) // Simulate success
}

val replicationPluginInterface = ReplicationPluginInterface()
// Call method under test
replicationPluginInterface.stopReplication(client, request, listener)
ReplicationPluginInterface.stopReplication(client, request, listener)
// Verify that listener.onResponse is called with the correct response
verify(listener).onResponse(acknowledgedResponse)
}
Expand All @@ -58,9 +57,8 @@ internal class ReplicationPluginInterfaceTests {
actionListener.onFailure(exception) // Simulate failure
}

val replicationPluginInterface = ReplicationPluginInterface()
// Call method under test
replicationPluginInterface.stopReplication(client, request, listener)
ReplicationPluginInterface.stopReplication(client, request, listener)
// Verify that listener.onResponse is called with the correct response
verify(listener).onFailure(exception)
}
Expand Down
Loading