|
@@ -1,9 +1,13 @@
|
|
|
package com.qmth.boot.test.solar;
|
|
|
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.qmth.boot.core.solar.model.AppLicense;
|
|
|
import com.qmth.boot.tools.crypto.RSA;
|
|
|
import com.qmth.boot.tools.device.DeviceInfo;
|
|
|
import com.qmth.boot.tools.models.ByteArray;
|
|
|
+import org.junit.Assert;
|
|
|
+import org.junit.Test;
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
@@ -15,4 +19,13 @@ public class AppLicenseUtilTest {
|
|
|
.encrypt(new ObjectMapper().writeValueAsBytes(DeviceInfo.current()))
|
|
|
.toFile(new File("/Users/luoshi/Downloads/solar/device-test.info"));
|
|
|
}
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testParseAppInfo() throws JsonProcessingException {
|
|
|
+ String content = "{\"id\":26,\"name\":\"本地部署\",\"code\":\"markingcloud\",\"control\":{\"expireTime\":33239779200000,\"maxOnlineUserCount\":10},\"orgs\":[]}";
|
|
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
+ AppLicense license = mapper.readValue(content, AppLicense.class);
|
|
|
+ Assert.assertNotNull(license);
|
|
|
+ Assert.assertEquals(26, (long) license.getId());
|
|
|
+ }
|
|
|
}
|