Mod aaa-12 fix domain handler test

RCA:
SOL:
修改人:maxiaonan
检视人:maxiaonan
This commit is contained in:
maxiaonan 2019-07-26 14:00:01 +08:00
parent a3ef648b3b
commit a9f28207d5
1 changed files with 14 additions and 1 deletions

View File

@ -28,6 +28,7 @@ import org.opendaylight.aaa.api.model.Domain;
import org.opendaylight.aaa.api.model.Domains;
import org.opendaylight.aaa.api.model.IDMError;
import org.opendaylight.aaa.api.model.Roles;
import org.opendaylight.aaa.shiro.idm.DomainHandler;
public class DomainHandlerTest extends HandlerTest {
@ -63,12 +64,13 @@ public class DomainHandlerTest extends HandlerTest {
clientResponse = target("/v1/domains").request().post(entity(domainData));
assertEquals(201, clientResponse.getStatus());
// check update domain data
domainData.put("name", "dom1Update");
clientResponse = target("/v1/domains/1").request().put(entity(domainData));
assertEquals(200, clientResponse.getStatus());
clientResponse = target("/v1/domains/101").request().put(entity(domainData));
assertEquals(404, clientResponse.getStatus());
@ -170,6 +172,16 @@ public class DomainHandlerTest extends HandlerTest {
clientResponse = target("/v1/domains/3/users/0/roles/0").request().delete();
assertEquals(404, clientResponse.getStatus());
// check delete grant for invalid user
clientResponse = target("/v1/domains/0/users/15/roles/0").request().delete();
assertEquals(404, clientResponse.getStatus());
// check delete grant for invalid role
clientResponse = target("/v1/domains/0/users/0/roles/134").request().delete();
assertEquals(404, clientResponse.getStatus());
// check delete domain
clientResponse = target("/v1/domains/1").request().delete();
assertEquals(204, clientResponse.getStatus());
@ -198,6 +210,7 @@ public class DomainHandlerTest extends HandlerTest {
clientResponse = target("/v1/domains/1/users/0/roles").request().post(entity(grantData));
assertEquals(400, clientResponse.getStatus());
}
}
/**
* Revision history