|
22 | 22 | import org.elasticsearch.cluster.routing.ShardRouting;
|
23 | 23 | import org.elasticsearch.cluster.routing.UnassignedInfo;
|
24 | 24 | import org.elasticsearch.common.bytes.BytesReference;
|
25 |
| -import org.elasticsearch.common.hash.MessageDigests; |
26 | 25 | import org.elasticsearch.common.network.NetworkModule;
|
27 | 26 | import org.elasticsearch.common.settings.Settings;
|
28 | 27 | import org.elasticsearch.common.transport.BoundTransportAddress;
|
|
51 | 50 | import org.junit.Before;
|
52 | 51 |
|
53 | 52 | import java.io.IOException;
|
54 |
| -import java.nio.charset.StandardCharsets; |
55 | 53 | import java.util.Collections;
|
56 | 54 | import java.util.List;
|
57 | 55 | import java.util.Map;
|
@@ -188,38 +186,6 @@ public void testNodesHash() {
|
188 | 186 | assertThat(ClusterStatsMonitoringDoc.nodesHash(nodes), equalTo(ephemeralIds.toString().hashCode()));
|
189 | 187 | }
|
190 | 188 |
|
191 |
| - public void testHash() { |
192 |
| - assertEquals("cc6628dbcfd052fba57870dc4eed4bc9f5cd5d43b4df46e97867aeb2dd7bd2e8", |
193 |
| - ClusterStatsMonitoringDoc.hash("licenseStatus", "licenseUid", "licenseType", "licenseExpiryDate", "clusterUUID")); |
194 |
| - } |
195 |
| - |
196 |
| - public void testHashWithLicense() { |
197 |
| - final StringBuilder builder = new StringBuilder(); |
198 |
| - |
199 |
| - final License license = mock(License.class); |
200 |
| - final License.Status status = randomFrom(License.Status.values()); |
201 |
| - when(license.status()).thenReturn(status); |
202 |
| - builder.append(status.label()); |
203 |
| - |
204 |
| - final String uuid = randomAlphaOfLength(10); |
205 |
| - when(license.uid()).thenReturn(uuid); |
206 |
| - builder.append(uuid); |
207 |
| - |
208 |
| - final String type = randomAlphaOfLength(10); |
209 |
| - when(license.type()).thenReturn(type); |
210 |
| - builder.append(type); |
211 |
| - |
212 |
| - final long expiryDate = randomNonNegativeLong(); |
213 |
| - when(license.expiryDate()).thenReturn(expiryDate); |
214 |
| - builder.append(String.valueOf(expiryDate)); |
215 |
| - |
216 |
| - final String cluster = randomAlphaOfLength(5); |
217 |
| - builder.append(cluster); |
218 |
| - |
219 |
| - assertEquals(MessageDigests.toHexString(MessageDigests.sha256().digest(builder.toString().getBytes(StandardCharsets.UTF_8))), |
220 |
| - ClusterStatsMonitoringDoc.hash(license, cluster)); |
221 |
| - } |
222 |
| - |
223 | 189 | @Override
|
224 | 190 | public void testToXContent() throws IOException {
|
225 | 191 | final ClusterName clusterName = new ClusterName("_cluster_name");
|
@@ -380,8 +346,7 @@ public void testToXContent() throws IOException {
|
380 | 346 | + "\"max_nodes\":2,"
|
381 | 347 | + "\"issued_to\":\"customer\","
|
382 | 348 | + "\"issuer\":\"elasticsearch\","
|
383 |
| - + "\"start_date_in_millis\":-1," |
384 |
| - + "\"hkey\":\"e05627254d639cf36346bf99934dc4a4ac9f37bdc9100cee450c10fa6322a6dd\"" |
| 349 | + + "\"start_date_in_millis\":-1" |
385 | 350 | + (needToEnableTLS ? ",\"cluster_needs_tls\":true" : "")
|
386 | 351 | + "},"
|
387 | 352 | + "\"cluster_stats\":{"
|
|
0 commit comments