|
|
|
@ -35,6 +35,7 @@ import org.apache.dolphinscheduler.dao.entity.Project;
|
|
|
|
|
import org.apache.dolphinscheduler.dao.entity.Resource; |
|
|
|
|
import org.apache.dolphinscheduler.dao.entity.Tenant; |
|
|
|
|
import org.apache.dolphinscheduler.dao.entity.User; |
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.AccessTokenMapper; |
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.AlertGroupMapper; |
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.DataSourceUserMapper; |
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; |
|
|
|
@ -79,6 +80,9 @@ public class UsersServiceTest {
|
|
|
|
|
@Mock |
|
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
|
|
@Mock |
|
|
|
|
private AccessTokenMapper accessTokenMapper; |
|
|
|
|
|
|
|
|
|
@Mock |
|
|
|
|
private TenantMapper tenantMapper; |
|
|
|
|
|
|
|
|
@ -221,7 +225,6 @@ public class UsersServiceTest {
|
|
|
|
|
Assert.assertEquals(user.getId(), userExistId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testQueryUserList() { |
|
|
|
|
User user = new User(); |
|
|
|
@ -286,7 +289,7 @@ public class UsersServiceTest {
|
|
|
|
|
try { |
|
|
|
|
when(userMapper.queryTenantCodeByUserId(1)).thenReturn(getUser()); |
|
|
|
|
when(userMapper.selectById(1)).thenReturn(getUser()); |
|
|
|
|
|
|
|
|
|
when(accessTokenMapper.deleteAccessTokenByUserId(1)).thenReturn(0); |
|
|
|
|
//no operate
|
|
|
|
|
Map<String, Object> result = usersService.deleteUserById(loginUser, 3); |
|
|
|
|
logger.info(result.toString()); |
|
|
|
@ -356,7 +359,6 @@ public class UsersServiceTest {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testGrantUDFFunction() { |
|
|
|
|
String udfIds = "100000,120000"; |
|
|
|
@ -431,7 +433,6 @@ public class UsersServiceTest {
|
|
|
|
|
Assert.assertEquals("userTest0001", tempUser.getUserName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testQueryAllGeneralUsers() { |
|
|
|
|
User loginUser = new User(); |
|
|
|
@ -478,7 +479,6 @@ public class UsersServiceTest {
|
|
|
|
|
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testAuthorizedUser() { |
|
|
|
|
User loginUser = new User(); |
|
|
|
@ -535,7 +535,6 @@ public class UsersServiceTest {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
public void testActivateUser() { |
|
|
|
|
User user = new User(); |
|
|
|
@ -618,7 +617,6 @@ public class UsersServiceTest {
|
|
|
|
|
return user; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* get user |
|
|
|
|
*/ |
|
|
|
|