Search in sources :

Example 1 with Status

use of com.xiaomi.shepher.common.Status in project shepher by XiaoMi.

the class PermissionServiceTest method testAddForTeamIdClusterPathStatus.

/**
 * Method: add(long teamId, String cluster, String path, Status status)
 */
@Test
public void testAddForTeamIdClusterPathStatus() throws Exception {
    long teamId = 5;
    Status status = Status.AGREE;
    String cluster = "local_test";
    String path = "/test";
    boolean addResult = permissionService.add(teamId, cluster, path, status);
    Assert.assertEquals(true, addResult);
}
Also used : Status(com.xiaomi.shepher.common.Status) BaseTest(com.xiaomi.shepher.BaseTest) Test(org.junit.Test)

Example 2 with Status

use of com.xiaomi.shepher.common.Status in project shepher by XiaoMi.

the class TeamServiceTest method testUpdateStatus.

/**
 * Method: updateStatus(long id, Status status)
 */
@Test
public void testUpdateStatus() throws Exception {
    long id = 3;
    Status status = Status.DELETE;
    int updateResult = teamService.updateStatus(id, status);
    Assert.assertEquals(RESULT_OK, updateResult);
}
Also used : Status(com.xiaomi.shepher.common.Status) Test(org.junit.Test) BaseTest(com.xiaomi.shepher.BaseTest)

Example 3 with Status

use of com.xiaomi.shepher.common.Status in project shepher by XiaoMi.

the class PermissionServiceTest method testUpdateStatus.

/**
 * Method: updateStatus(long id, Status status)
 */
@Test
public void testUpdateStatus() throws Exception {
    int id = 3;
    Status status = Status.AGREE;
    int updateResult = permissionService.updateStatus(id, status);
    Assert.assertEquals(RESULT_OK, updateResult);
}
Also used : Status(com.xiaomi.shepher.common.Status) BaseTest(com.xiaomi.shepher.BaseTest) Test(org.junit.Test)

Example 4 with Status

use of com.xiaomi.shepher.common.Status in project shepher by XiaoMi.

the class PermissionServiceTest method testAddForPermissionIdTeamIdStatus.

/**
 * Method: add(long permissionId, long teamId, Status status)
 */
@Test
public void testAddForPermissionIdTeamIdStatus() throws Exception {
    long permissionId = 3;
    long teamId = 5;
    Status status = Status.AGREE;
    PermissionTeam permissionTeam = permissionService.add(permissionId, teamId, status);
    Assert.assertNotNull(permissionTeam);
    Assert.assertEquals(4, permissionTeam.getId());
}
Also used : Status(com.xiaomi.shepher.common.Status) PermissionTeam(com.xiaomi.shepher.model.PermissionTeam) BaseTest(com.xiaomi.shepher.BaseTest) Test(org.junit.Test)

Aggregations

BaseTest (com.xiaomi.shepher.BaseTest)4 Status (com.xiaomi.shepher.common.Status)4 Test (org.junit.Test)4 PermissionTeam (com.xiaomi.shepher.model.PermissionTeam)1