remove using License.builder in marvel test
Original commit: elastic/x-pack-elasticsearch@bef6683b12
This commit is contained in:
parent
3d5fef9d8f
commit
ef11bc3f05
|
@ -67,7 +67,11 @@ public class LicensesRenderer extends AbstractRenderer<LicensesMarvelDoc> {
|
|||
}
|
||||
|
||||
public static String hash(License license, String clusterName) {
|
||||
String toHash = status(license) + license.uid() + license.type() + String.valueOf(license.expiryDate()) + clusterName;
|
||||
return hash(status(license), license.uid(), license.type(), String.valueOf(license.expiryDate()), clusterName);
|
||||
}
|
||||
|
||||
public static String hash(String licenseStatus, String licenseUid, String licenseType, String licenseExpiryDate, String clusterName) {
|
||||
String toHash = licenseStatus + licenseUid + licenseType + licenseExpiryDate + clusterName;
|
||||
return Hashing.sha256().hashString(toHash, Charsets.UTF_8).toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ public class LicensesRendererIT extends ESIntegTestCase {
|
|||
|
||||
// We basically recompute the hash here
|
||||
String hkey = (String) ((Map) license).get(LicensesRenderer.Fields.HKEY.underscore().toString());
|
||||
String recalculated = LicensesRenderer.hash(License.builder().uid(uid).type(type).expiryDate(expiryDate).build(), cluster().getClusterName());
|
||||
String recalculated = LicensesRenderer.hash(status, uid, type, String.valueOf(expiryDate), cluster().getClusterName());
|
||||
assertThat(hkey, equalTo(recalculated));
|
||||
|
||||
assertThat((String) ((Map) license).get(LicensesRenderer.Fields.FEATURE.underscore().toString()), not(isEmptyOrNullString()));
|
||||
|
|
Loading…
Reference in New Issue