diff --git a/src/main/resources/mappers/UserAccount.xml b/src/main/resources/mappers/UserAccount.xml index 9e65c49e..9db75d3a 100644 --- a/src/main/resources/mappers/UserAccount.xml +++ b/src/main/resources/mappers/UserAccount.xml @@ -92,7 +92,7 @@ UPDATE user_account - SET status = ${@com.dispose.common.ObjectStatus@DELETED.getCode()}, + SET status = ${@com.dispose.common.ObjectStatus@DELETED.getValue()}, operators = #{operators}, lockTime = CURRENT_TIMESTAMP WHERE username = #{username, jdbcType=VARCHAR} @@ -101,7 +101,7 @@ UPDATE user_account - SET status = ${@com.dispose.common.ObjectStatus@DISABLED.getCode()}, + SET status = ${@com.dispose.common.ObjectStatus@DISABLED.getValue()}, operators = #{operators}, lockTime = CURRENT_TIMESTAMP WHERE username = #{username, jdbcType=VARCHAR} @@ -110,7 +110,7 @@ UPDATE user_account - SET status = ${@com.dispose.common.ObjectStatus@LOCKED.getCode()}, + SET status = ${@com.dispose.common.ObjectStatus@LOCKED.getValue()}, lockTime = CURRENT_TIMESTAMP WHERE username = #{username, jdbcType=VARCHAR} @@ -118,7 +118,7 @@ UPDATE user_account - SET status = ${@com.dispose.common.ObjectStatus@NORMAL.getCode()}, + SET status = ${@com.dispose.common.ObjectStatus@NORMAL.getValue()}, lockTime = 0 WHERE username = #{username, jdbcType=VARCHAR} diff --git a/src/test/java/com/dispose/test/manager/UserAccountManagerTest.java b/src/test/java/com/dispose/test/manager/UserAccountManagerTest.java index 6e5c8e4a..406163e9 100644 --- a/src/test/java/com/dispose/test/manager/UserAccountManagerTest.java +++ b/src/test/java/com/dispose/test/manager/UserAccountManagerTest.java @@ -48,8 +48,11 @@ public class UserAccountManagerTest extends InitTestEnvironment { public void userLogin() { } + /** + * A 1 get UserAccount by token. + */ @Test - public void a1_getUserByName() { + public void a1_getUserByToken() { userAccountMapper.selectAll().forEach(v -> { try { String token = userAccountManager.getUserToken(v.getUsername()); @@ -68,8 +71,11 @@ public class UserAccountManagerTest extends InitTestEnvironment { }); } + /** + * A 2 get UserAccount by name. + */ @Test - public void a2_getUserByToken() { + public void a2_getUserByName() { userAccountMapper.selectAll().forEach(v -> { UserAccount user = userAccountManager.getUserByName(v.getUsername()); @@ -86,6 +92,9 @@ public class UserAccountManagerTest extends InitTestEnvironment { }); } + /** + * A 3 get UserAccount by name. + */ @Test public void a3_getUserToken() { userAccountMapper.selectAll().forEach(v -> { @@ -101,6 +110,9 @@ public class UserAccountManagerTest extends InitTestEnvironment { }); } + /** + * A 4 set UserAccount password error times. + */ @Test public void a4_setUserPwdErrTimes() { userAccountMapper.selectAll().forEach(v -> { @@ -125,6 +137,9 @@ public class UserAccountManagerTest extends InitTestEnvironment { }); } + /** + * A5 clean user token. + */ @Test public void a5_cleanUserToken() { userAccountMapper.selectAll().forEach(v -> { @@ -147,6 +162,9 @@ public class UserAccountManagerTest extends InitTestEnvironment { }); } + /** + * A6 Verify token error code. + */ @Test public void a6_verifyTokenTest() throws NoSuchAlgorithmException { String userToken = userAccountManager.getUserToken(getUSER_NAME()); @@ -157,6 +175,9 @@ public class UserAccountManagerTest extends InitTestEnvironment { Assert.assertEquals(userAccountManager.verifyToken(userToken + "123"), ErrorCode.ERR_LOGOUT); } + /** + * A7 Lock and Unlock user account. Disable and Delete user account. + */ @Test public void a7_userAccountStatus() { userAccountMapper.selectAll().forEach(v -> { @@ -186,6 +207,9 @@ public class UserAccountManagerTest extends InitTestEnvironment { }); } + /** + * A8 Verify token permission. + */ @Test public void a8_verifyTokePermission() { userAccountMapper.selectAll().forEach(v -> {