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
d47e10bf
Commit
d47e10bf
authored
Jan 10, 2018
by
技术部-任文超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新Service测试用例
parent
5cc04e15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
UserAuthorizedServiceTests.java
src/test/java/service/UserAuthorizedServiceTests.java
+14
-16
No files found.
src/test/java/service/UserAuthorizedServiceTests.java
View file @
d47e10bf
package
service
;
import
cn.quantgroup.xyqb.Bootstrap
;
import
cn.quantgroup.xyqb.entity.UserAuthorized
;
import
cn.quantgroup.xyqb.model.AuthPattern
;
import
cn.quantgroup.xyqb.model.UserAuthorizedParam
;
import
cn.quantgroup.xyqb.service.auth.IUserAuthorizedService
;
import
com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer
;
import
demo.BaseParametersTests
;
...
...
@@ -18,6 +20,7 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.Optional
;
/**
* 业务层测试用例
...
...
@@ -35,17 +38,12 @@ public class UserAuthorizedServiceTests extends BaseParametersTests {
@Autowired
private
IUserAuthorizedService
userAuthorizedService
;
private
Long
userId
;
private
String
idNo
;
private
String
name
;
private
AuthPattern
authPattern
;
private
Boolean
available
;
UserAuthorizedParam
obj
=
new
UserAuthorizedParam
();
public
UserAuthorizedServiceTests
(
Long
userId
,
String
idNo
,
String
name
,
AuthPattern
authPattern
,
Boolean
available
)
{
this
.
userId
=
userId
;
this
.
idNo
=
idNo
;
this
.
name
=
name
;
this
.
authPattern
=
authPattern
;
this
.
available
=
available
;
obj
.
setUserId
(
userId
);
obj
.
setIdNo
(
idNo
);
obj
.
setName
(
name
);
obj
.
setAuthPattern
(
Optional
.
ofNullable
(
authPattern
).
orElse
(
AuthPattern
.
ZMXY
).
name
());
}
@Parameterized
.
Parameters
...
...
@@ -61,22 +59,22 @@ public class UserAuthorizedServiceTests extends BaseParametersTests {
@Test
public
void
testExist
()
throws
Exception
{
log
.
info
(
"testExist: name:{}, idNo:{}, userId:{}, authPattern:{}"
,
this
.
name
,
this
.
idNo
,
this
.
userId
,
this
.
authPattern
);
Object
obj
=
userAuthorizedService
.
hasUserAuthorized
(
this
.
idNo
);
log
.
info
(
"testExist: name:{}, idNo:{}, userId:{}, authPattern:{}"
,
obj
.
getName
(),
obj
.
getIdNo
(),
obj
.
getUserId
(),
obj
.
getAuthPattern
()
);
Object
obj
=
userAuthorizedService
.
hasUserAuthorized
(
this
.
obj
.
getIdNo
()
);
Assert
.
assertNotNull
(
obj
);
}
@Test
public
void
testSave
()
throws
Exception
{
log
.
info
(
"testSave: name:{}, idNo:{}, userId:{}, authPattern:{}"
,
this
.
name
,
this
.
idNo
,
this
.
userId
,
this
.
authPattern
);
Object
obj
=
userAuthorizedService
.
createUserAuthorized
(
this
.
name
,
this
.
idNo
,
this
.
userId
,
this
.
authPattern
.
name
()
);
log
.
info
(
"testSave: name:{}, idNo:{}, userId:{}, authPattern:{}"
,
obj
.
getName
(),
obj
.
getIdNo
(),
obj
.
getUserId
(),
obj
.
getAuthPattern
()
);
Object
obj
=
userAuthorizedService
.
createUserAuthorized
(
this
.
obj
);
Assert
.
assertNotNull
(
obj
);
}
@Test
public
void
testQuery
(){
log
.
info
(
"testQuery: name:{}, idNo:{}, userId:{}, authPattern:{}"
,
this
.
name
,
this
.
idNo
,
this
.
userId
,
this
.
authPattern
);
Object
obj
=
userAuthorizedService
.
getUserAuthorizedId
(
this
.
userId
);
log
.
info
(
"testQuery: name:{}, idNo:{}, userId:{}, authPattern:{}"
,
obj
.
getName
(),
obj
.
getIdNo
(),
obj
.
getUserId
(),
obj
.
getAuthPattern
()
);
Object
obj
=
userAuthorizedService
.
getUserAuthorizedId
(
this
.
obj
.
getUserId
()
);
Assert
.
assertNotNull
(
obj
);
}
...
...
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