Skip to content

Commit

Permalink
Fixed test file
Browse files Browse the repository at this point in the history
Signed-off-by: Somesh Gupta <someshgupta987@gmail.com>

Added license
  • Loading branch information
aasom143 committed Aug 31, 2024
1 parent f689a76 commit 24d16a2
Showing 1 changed file with 35 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,39 +1,58 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

package org.opensearch.action.admin.indices.shards;

import org.opensearch.action.admin.cluster.shards.CatShardsResponse;
import org.opensearch.action.admin.cluster.state.ClusterStateResponse;
import org.opensearch.action.admin.indices.stats.IndicesStatsResponse;
import org.opensearch.cluster.ClusterName;
import org.junit.Before;
import org.junit.Test;
import org.opensearch.test.OpenSearchTestCase;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

public class CatShardsResponseTests {

private CatShardsResponse catShardsResponse;
public class CatShardsResponseTests extends OpenSearchTestCase {

@Before
public void setUp() {
catShardsResponse = new CatShardsResponse();
}
private final CatShardsResponse catShardsResponse = new CatShardsResponse();

@Test
public void testGetAndSetClusterStateResponse() {
assertNull(catShardsResponse.getClusterStateResponse());

ClusterName clusterName = new ClusterName("1");
ClusterStateResponse clusterStateResponse = new ClusterStateResponse(clusterName, null, false);
catShardsResponse.setClusterStateResponse(clusterStateResponse);

assertEquals(clusterStateResponse, catShardsResponse.getClusterStateResponse());
}

@Test
public void testGetAndSetIndicesStatsResponse() {
assertNull(catShardsResponse.getIndicesStatsResponse());

final IndicesStatsResponse indicesStatsResponse = new IndicesStatsResponse(null, 0, 0, 0, null);
catShardsResponse.setIndicesStatsResponse(indicesStatsResponse);

Expand Down

0 comments on commit 24d16a2

Please sign in to comment.