Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
99bfb717
Commit
99bfb717
authored
Feb 06, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QG模式变绿
parent
daff6d10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
GeetestCaptchaServiceTest.java
src/test/java/service/GeetestCaptchaServiceTest.java
+7
-5
QuantgroupCaptchaServiceTest.java
src/test/java/service/QuantgroupCaptchaServiceTest.java
+3
-3
No files found.
src/test/java/service/GeetestCaptchaServiceTest.java
View file @
99bfb717
package
service
;
package
service
;
import
cn.quantgroup.xyqb.Bootstrap
;
import
cn.quantgroup.xyqb.Bootstrap
;
import
cn.quantgroup.xyqb.Constants
;
import
cn.quantgroup.xyqb.model.ClientType
;
import
cn.quantgroup.xyqb.model.ClientType
;
import
cn.quantgroup.xyqb.service.captcha.IGeetestCaptchaService
;
import
cn.quantgroup.xyqb.service.captcha.IGeetestCaptchaService
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
import
cn.quantgroup.xyqb.util.PasswordUtil
;
...
@@ -19,7 +20,6 @@ import java.util.Map;
...
@@ -19,7 +20,6 @@ import java.util.Map;
@SpringBootTest
(
classes
=
Bootstrap
.
class
)
@SpringBootTest
(
classes
=
Bootstrap
.
class
)
@ContextConfiguration
(
initializers
=
ApolloPropertySourceInitializer
.
class
)
@ContextConfiguration
(
initializers
=
ApolloPropertySourceInitializer
.
class
)
public
class
GeetestCaptchaServiceTest
{
public
class
GeetestCaptchaServiceTest
{
@Resource
@Resource
private
IGeetestCaptchaService
geetestCaptchaService
;
private
IGeetestCaptchaService
geetestCaptchaService
;
...
@@ -32,14 +32,16 @@ public class GeetestCaptchaServiceTest {
...
@@ -32,14 +32,16 @@ public class GeetestCaptchaServiceTest {
public
void
testFetchGeetestCaptcha
(){
public
void
testFetchGeetestCaptcha
(){
data
=
geetestCaptchaService
.
fetchGeetestCaptcha
(
PasswordUtil
.
MD5
(
phoneNo
),
remoteIp
,
clientType
);
data
=
geetestCaptchaService
.
fetchGeetestCaptcha
(
PasswordUtil
.
MD5
(
phoneNo
),
remoteIp
,
clientType
);
Assert
.
assertNotNull
(
data
);
Assert
.
assertNotNull
(
data
);
Assert
.
assertTrue
(
data
.
containsKey
(
Constants
.
VERIFY_PARAM
));
Assert
.
assertTrue
(
data
.
containsKey
(
"gt"
));
Assert
.
assertTrue
(
data
.
containsKey
(
"challenge"
));
}
}
@Test
@Test
public
void
testValidGeetestCaptcha
(){
public
void
testValidGeetestCaptcha
(){
String
challenge
=
"
d6e965e06b187c0a01276834d2ff00e
6"
;
String
challenge
=
"
c5372e93d6496f7bl096b7cl4fd6732c7
6"
;
String
validate
=
"
validat
e"
;
String
validate
=
"
ba4df3e99129cal4893accb29b46bf8
e"
;
String
seccode
=
"
seccode
"
;
String
seccode
=
"
ba4df3e99129cal4893accb29b46bf8e|jordan
"
;
Assert
.
assertTrue
(
geetestCaptchaService
.
validGeetestCaptcha
(
PasswordUtil
.
MD5
(
phoneNo
),
remoteIp
,
clientType
,
challenge
,
validate
,
seccode
));
Assert
.
assertTrue
(
geetestCaptchaService
.
validGeetestCaptcha
(
PasswordUtil
.
MD5
(
phoneNo
),
remoteIp
,
clientType
,
challenge
,
validate
,
seccode
));
}
}
}
}
src/test/java/service/QuantgroupCaptchaServiceTest.java
View file @
99bfb717
...
@@ -29,9 +29,9 @@ public class QuantgroupCaptchaServiceTest {
...
@@ -29,9 +29,9 @@ public class QuantgroupCaptchaServiceTest {
@Test
@Test
public
void
testValidQuantgroupCaptcha
(){
public
void
testValidQuantgroupCaptcha
(){
String
captchaId
=
"
captchaId
"
;
String
captchaId
=
"
b233ed97-02b7-4b85-9c1b-bfc2729682a4
"
;
String
captchaValue
=
"
captchaValue
"
;
String
captchaValue
=
"
0000
"
;
Assert
.
assert
Tru
e
(
quantgroupCaptchaService
.
validQuantgroupCaptcha
(
captchaId
,
captchaValue
));
Assert
.
assert
Fals
e
(
quantgroupCaptchaService
.
validQuantgroupCaptcha
(
captchaId
,
captchaValue
));
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment