Search in sources :

Example 1 with UnassignUsersRQ

use of com.epam.ta.reportportal.ws.model.project.UnassignUsersRQ in project service-api by reportportal.

the class ProjectControllerTest method unassignProjectUsersPositive.

@Test
void unassignProjectUsersPositive() throws Exception {
    UnassignUsersRQ rq = new UnassignUsersRQ();
    rq.setUsernames(singletonList("test_user"));
    mockMvc.perform(put("/v1/project/test_project/unassign").with(token(oAuthHelper.getSuperadminToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(rq))).andExpect(status().isOk());
}
Also used : UnassignUsersRQ(com.epam.ta.reportportal.ws.model.project.UnassignUsersRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 2 with UnassignUsersRQ

use of com.epam.ta.reportportal.ws.model.project.UnassignUsersRQ in project service-api by reportportal.

the class ProjectControllerTest method unassignUsersEmptyUserNames.

@Test
void unassignUsersEmptyUserNames() throws Exception {
    UnassignUsersRQ rq = new UnassignUsersRQ();
    rq.setUsernames(new ArrayList<>());
    mockMvc.perform(put("/v1/project/test_project/unassign").with(token(oAuthHelper.getSuperadminToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(rq))).andExpect(status().isBadRequest());
}
Also used : UnassignUsersRQ(com.epam.ta.reportportal.ws.model.project.UnassignUsersRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Aggregations

BaseMvcTest (com.epam.ta.reportportal.ws.BaseMvcTest)2 UnassignUsersRQ (com.epam.ta.reportportal.ws.model.project.UnassignUsersRQ)2 Test (org.junit.jupiter.api.Test)2