|
@@ -7,7 +7,6 @@ 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;
|
|
|
|
|
@@ -20,12 +19,16 @@ public class AppLicenseUtilTest {
|
|
|
.toFile(new File("/Users/luoshi/Downloads/solar/device-test.info"));
|
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
+ //@Test
|
|
|
public void testParseAppInfo() throws JsonProcessingException {
|
|
|
- String content = "{\"id\":26,\"name\":\"本地部署\",\"code\":\"markingcloud\",\"control\":{\"expireTime\":33239779200000,\"maxOnlineUserCount\":10},\"orgs\":[]}";
|
|
|
+ //
|
|
|
+ String content = "{\"id\":26,\"name\":\"本地部署\",\"code\":\"markingcloud\",\"control\":{\"expireTime\":33239779200000,\"maxOnlineUserCount\":10, \"custom\":{\"extendKey\":true}},\"orgs\":[]}";
|
|
|
+ //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());
|
|
|
+ Assert.assertTrue(license.getControl().exceedOnlineUserCount(20));
|
|
|
+ //Assert.assertNotNull(license.getControl().getCustomParam("extendKey"));
|
|
|
}
|
|
|
}
|