Search in sources :

Example 1 with ProjectUser

use of org.apache.dolphinscheduler.dao.entity.ProjectUser in project dolphinscheduler by apache.

the class ProjectUserMapperTest method insertOne.

/**
 * insert
 * @return ProjectUser
 */
private ProjectUser insertOne() {
    // insertOne
    ProjectUser projectUser = new ProjectUser();
    projectUser.setProjectId(1010);
    projectUser.setUserId(111);
    projectUserMapper.insert(projectUser);
    return projectUser;
}
Also used : ProjectUser(org.apache.dolphinscheduler.dao.entity.ProjectUser)

Example 2 with ProjectUser

use of org.apache.dolphinscheduler.dao.entity.ProjectUser in project dolphinscheduler by apache.

the class ProjectUserMapperTest method testQueryProjectRelation.

/**
 * test query project relation
 */
@Test
public void testQueryProjectRelation() {
    ProjectUser projectUser = insertOne();
    ProjectUser projectUser1 = projectUserMapper.queryProjectRelation(projectUser.getProjectId(), projectUser.getUserId());
    Assert.assertNotEquals(projectUser1, null);
}
Also used : ProjectUser(org.apache.dolphinscheduler.dao.entity.ProjectUser) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 3 with ProjectUser

use of org.apache.dolphinscheduler.dao.entity.ProjectUser in project dolphinscheduler by apache.

the class ProjectServiceTest method getProjectUser.

/**
 * get project user
 */
private ProjectUser getProjectUser() {
    ProjectUser projectUser = new ProjectUser();
    projectUser.setProjectId(1);
    projectUser.setUserId(1);
    return projectUser;
}
Also used : ProjectUser(org.apache.dolphinscheduler.dao.entity.ProjectUser)

Example 4 with ProjectUser

use of org.apache.dolphinscheduler.dao.entity.ProjectUser in project dolphinscheduler by apache.

the class ProjectUserMapperTest method testQuery.

/**
 * test query
 */
@Test
public void testQuery() {
    ProjectUser projectUser = insertOne();
    // query
    List<ProjectUser> projectUsers = projectUserMapper.selectList(null);
    Assert.assertNotEquals(projectUsers.size(), 0);
}
Also used : ProjectUser(org.apache.dolphinscheduler.dao.entity.ProjectUser) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 5 with ProjectUser

use of org.apache.dolphinscheduler.dao.entity.ProjectUser in project dolphinscheduler by apache.

the class ProjectUserMapperTest method testUpdate.

/**
 * test update
 */
@Test
public void testUpdate() {
    // insertOne
    ProjectUser projectUser = insertOne();
    projectUser.setCreateTime(new Date());
    // update
    int update = projectUserMapper.updateById(projectUser);
    Assert.assertEquals(update, 1);
}
Also used : ProjectUser(org.apache.dolphinscheduler.dao.entity.ProjectUser) Date(java.util.Date) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

ProjectUser (org.apache.dolphinscheduler.dao.entity.ProjectUser)7 Test (org.junit.Test)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 Date (java.util.Date)1