Improve some license params (#73)
diff --git a/pom.xml b/pom.xml
index 23b7f4b..993ae37 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
<groupId>com.baidu.hugegraph</groupId>
<artifactId>hugegraph-common</artifactId>
- <version>1.8.6</version>
+ <version>1.8.7</version>
<name>hugegraph-common</name>
<url>https://github.com/hugegraph/hugegraph-common</url>
@@ -287,7 +287,7 @@
<manifestEntries>
<!-- Must be on one line, otherwise the automatic
upgrade script cannot replace the version number -->
- <Implementation-Version>1.8.6.0</Implementation-Version>
+ <Implementation-Version>1.8.7.0</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
diff --git a/src/main/java/com/baidu/hugegraph/license/LicenseCreateParam.java b/src/main/java/com/baidu/hugegraph/license/LicenseCreateParam.java
index 00f0bdc..cd7c504 100644
--- a/src/main/java/com/baidu/hugegraph/license/LicenseCreateParam.java
+++ b/src/main/java/com/baidu/hugegraph/license/LicenseCreateParam.java
@@ -24,6 +24,7 @@
import org.apache.commons.lang3.time.DateUtils;
+import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -35,9 +36,11 @@
@JsonProperty("private_alias")
private String privateAlias;
+ @JsonAlias("key_ticket")
@JsonProperty("key_password")
private String keyPassword;
+ @JsonAlias("store_ticket")
@JsonProperty("store_password")
private String storePassword;
diff --git a/src/main/java/com/baidu/hugegraph/license/LicenseVerifyParam.java b/src/main/java/com/baidu/hugegraph/license/LicenseVerifyParam.java
index f2359bf..97c200f 100644
--- a/src/main/java/com/baidu/hugegraph/license/LicenseVerifyParam.java
+++ b/src/main/java/com/baidu/hugegraph/license/LicenseVerifyParam.java
@@ -19,6 +19,7 @@
package com.baidu.hugegraph.license;
+import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;
public class LicenseVerifyParam {
@@ -29,6 +30,7 @@
@JsonProperty("public_alias")
private String publicAlias;
+ @JsonAlias("store_ticket")
@JsonProperty("store_password")
private String storePassword;
diff --git a/src/main/java/com/baidu/hugegraph/version/CommonVersion.java b/src/main/java/com/baidu/hugegraph/version/CommonVersion.java
index 0013e08..0ae81e5 100644
--- a/src/main/java/com/baidu/hugegraph/version/CommonVersion.java
+++ b/src/main/java/com/baidu/hugegraph/version/CommonVersion.java
@@ -27,5 +27,5 @@
// The second parameter of Version.of() is for all-in-one JAR
public static final Version VERSION = Version.of(CommonVersion.class,
- "1.8.6");
+ "1.8.7");
}
diff --git a/src/test/java/com/baidu/hugegraph/unit/license/LicenseCreateParamTest.java b/src/test/java/com/baidu/hugegraph/unit/license/LicenseCreateParamTest.java
index 76f6847..fb5a16f 100644
--- a/src/test/java/com/baidu/hugegraph/unit/license/LicenseCreateParamTest.java
+++ b/src/test/java/com/baidu/hugegraph/unit/license/LicenseCreateParamTest.java
@@ -37,8 +37,8 @@
String json = "{"
+ "\"subject\":\"hugegraph-evaluation\","
+ "\"private_alias\":\"privatekey\","
- + "\"key_password\":\"123456\","
- + "\"store_password\":\"123456\","
+ + "\"key_ticket\":\"a123456\","
+ + "\"store_ticket\":\"a123456\","
+ "\"privatekey_path\":\"./privateKeys.store\","
+ "\"license_path\":\"./hugegraph-evaluation.license\","
+ "\"issued_time\":\"2019-08-10 00:00:00\","
@@ -85,8 +85,8 @@
LicenseCreateParam.class);
Assert.assertEquals("hugegraph-evaluation", param.subject());
Assert.assertEquals("privatekey", param.privateAlias());
- Assert.assertEquals("123456", param.keyPassword());
- Assert.assertEquals("123456", param.storePassword());
+ Assert.assertEquals("a123456", param.keyPassword());
+ Assert.assertEquals("a123456", param.storePassword());
Assert.assertEquals("./privateKeys.store", param.privateKeyPath());
Assert.assertEquals("./hugegraph-evaluation.license",
param.licensePath());
diff --git a/src/test/java/com/baidu/hugegraph/unit/license/LicenseVerifyParamTest.java b/src/test/java/com/baidu/hugegraph/unit/license/LicenseVerifyParamTest.java
index f1126ce..5172f7d 100644
--- a/src/test/java/com/baidu/hugegraph/unit/license/LicenseVerifyParamTest.java
+++ b/src/test/java/com/baidu/hugegraph/unit/license/LicenseVerifyParamTest.java
@@ -34,7 +34,7 @@
String json = "{"
+ "\"subject\":\"hugegraph-evaluation\","
+ "\"public_alias\":\"publiccert\","
- + "\"store_password\":\"123456\","
+ + "\"store_ticket\":\"a123456\","
+ "\"publickey_path\":\"./publicCerts.store\","
+ "\"license_path\":\"./hugegraph-evaluation.license\""
+ "}";
@@ -43,7 +43,7 @@
LicenseVerifyParam.class);
Assert.assertEquals("hugegraph-evaluation", param.subject());
Assert.assertEquals("publiccert", param.publicAlias());
- Assert.assertEquals("123456", param.storePassword());
+ Assert.assertEquals("a123456", param.storePassword());
Assert.assertEquals("./publicCerts.store", param.publicKeyPath());
Assert.assertEquals("./hugegraph-evaluation.license",
param.licensePath());
diff --git a/src/test/java/com/baidu/hugegraph/unit/util/VersionUtilTest.java b/src/test/java/com/baidu/hugegraph/unit/util/VersionUtilTest.java
index 49fcdac..70a40c8 100644
--- a/src/test/java/com/baidu/hugegraph/unit/util/VersionUtilTest.java
+++ b/src/test/java/com/baidu/hugegraph/unit/util/VersionUtilTest.java
@@ -129,7 +129,7 @@
//Mockito.when(clazz.getResource("fake.class")).thenReturn(manifest);
String manifestPath = "file:./src/test/resources";
- Assert.assertEquals("1.8.6.0",
+ Assert.assertEquals("1.8.7.0",
VersionUtil.getImplementationVersion(manifestPath));
manifestPath = "file:./src/test/resources2";
diff --git a/src/test/resources/META-INF/MANIFEST.MF b/src/test/resources/META-INF/MANIFEST.MF
index fe44310..252019b 100644
--- a/src/test/resources/META-INF/MANIFEST.MF
+++ b/src/test/resources/META-INF/MANIFEST.MF
@@ -1,9 +1,9 @@
Manifest-Version: 1.0
-Implementation-Version: 1.8.6.0
+Implementation-Version: 1.8.7.0
Archiver-Version: Plexus Archiver
Built-By: jermy
Specification-Title: hugegraph-common
Created-By: Apache Maven 3.3.9
Build-Jdk: 1.8.0_111
-Specification-Version: 1.8.6
+Specification-Version: 1.8.7
diff --git a/src/test/resources/create-license.json b/src/test/resources/create-license.json
index 26b3bd5..c113131 100644
--- a/src/test/resources/create-license.json
+++ b/src/test/resources/create-license.json
@@ -1,8 +1,8 @@
{
"subject": "hugegraph-evaluation",
"private_alias": "privatekey",
- "key_password": "private_password123456",
- "store_password": "public_password123456",
+ "key_ticket": "a123456",
+ "store_ticket": "a123456",
"privatekey_path": "src/test/resources/privateKeys.store",
"license_path": "src/test/resources/hugegraph-evaluation.license",
"issued_time": "2019-08-01 00:00:00",
diff --git a/src/test/resources/privateKeys.store b/src/test/resources/privateKeys.store
index 836e413..4982719 100644
--- a/src/test/resources/privateKeys.store
+++ b/src/test/resources/privateKeys.store
Binary files differ
diff --git a/src/test/resources/publicCerts.store b/src/test/resources/publicCerts.store
index 7eee045..e6624be 100644
--- a/src/test/resources/publicCerts.store
+++ b/src/test/resources/publicCerts.store
Binary files differ
diff --git a/src/test/resources/verify-license.json b/src/test/resources/verify-license.json
index 277e25d..779c5d6 100644
--- a/src/test/resources/verify-license.json
+++ b/src/test/resources/verify-license.json
@@ -1,7 +1,7 @@
{
"subject": "hugegraph-evaluation",
"public_alias": "publiccert",
- "store_password": "public_password123456",
+ "store_ticket": "a123456",
"publickey_path": "src/test/resources/publicCerts.store",
"license_path": "src/test/resources/hugegraph-evaluation.license"
}