Skip to content

Commit

Permalink
Fix Unit test after remove state enabled assertion
Browse files Browse the repository at this point in the history
Signed-off-by: Sooraj Sinha <[email protected]>
  • Loading branch information
soosinha committed Aug 31, 2023
1 parent 42af4dd commit 99734f1
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;

public class RemoteClusterStateServiceTests extends OpenSearchTestCase {
Expand Down Expand Up @@ -80,19 +79,18 @@ public void testFailWriteFullMetadataNonClusterManagerNode() throws IOException
Assert.assertThat(manifest, nullValue());
}

public void testFailWriteFullMetadataWhenRemoteStateDisabled() throws IOException {
public void testFailInitializationWhenRemoteStateDisabled() throws IOException {
final Settings settings = Settings.builder().build();
remoteClusterStateService = spy(
new RemoteClusterStateService(
assertThrows(
AssertionError.class,
() -> new RemoteClusterStateService(
"test-node-id",
repositoriesServiceSupplier,
settings,
new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS),
() -> 0L
)
);
final ClusterState clusterState = generateClusterStateWithOneIndex().nodes(nodesWithLocalNodeClusterManager()).build();
assertThrows(AssertionError.class, () -> remoteClusterStateService.writeFullMetadata(clusterState));
}

public void testFailWriteFullMetadataWhenRepositoryNotSet() {
Expand Down

0 comments on commit 99734f1

Please sign in to comment.