Commit 9783b968 authored by 贷前—徐菲's avatar 贷前—徐菲

单元测试

parent cb7fd9c5
package demo;
package service;
import cn.quantgroup.xyqb.Bootstrap;
import cn.quantgroup.xyqb.model.ClientType;
......@@ -24,7 +24,7 @@ public class GeetestCaptchaServiceTest {
@Test
public void testFetchGeetestCaptcha(){
Assert.assertNotEquals(null,geetestCaptchaService.fetchGeetestCaptcha(PasswordUtil.MD5("18010043006"),"127.0.0.1", ClientType.APP));
Assert.assertNotNull(geetestCaptchaService.fetchGeetestCaptcha(PasswordUtil.MD5("18010043006"),"127.0.0.1", ClientType.APP));
}
......@@ -33,8 +33,6 @@ public class GeetestCaptchaServiceTest {
String challenge = "d6e965e06b187c0a01276834d2ff00e6";
String validate = "validate";
String seccode = "seccode";
Assert.assertEquals(true,
geetestCaptchaService.validGeetestCaptcha(ClientType.APP,"127.0.0.1", PasswordUtil.MD5("18010043006"),challenge,validate,seccode));
Assert.assertTrue(geetestCaptchaService.validGeetestCaptcha(ClientType.APP,"127.0.0.1", PasswordUtil.MD5("18010043006"),challenge,validate,seccode));
}
}
package demo;
package service;
import cn.quantgroup.xyqb.Bootstrap;
import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
......@@ -23,7 +23,7 @@ public class QuantgroupCaptchaServiceTest {
@Test
public void testFetchQuantgroupCaptcha(){
Locale locale = Locale.US;
Assert.assertEquals(null,quantgroupCaptchaService.fetchQuantgroupCaptcha(locale));
Assert.assertNotNull(quantgroupCaptchaService.fetchQuantgroupCaptcha(locale));
}
......@@ -31,7 +31,7 @@ public class QuantgroupCaptchaServiceTest {
public void testValidQuantgroupCaptcha(){
String captchaId="captchaId";
String captchaValue="captchaValue";
Assert.assertEquals(true,quantgroupCaptchaService.validQuantgroupCaptcha(captchaId,captchaValue));
Assert.assertTrue(quantgroupCaptchaService.validQuantgroupCaptcha(captchaId,captchaValue));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment