Search in sources :

Example 1 with DeleteBulkRQ

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

the class UserControllerTest method deleteUsers.

@Test
void deleteUsers() throws Exception {
    DeleteBulkRQ deleteBulkRQ = new DeleteBulkRQ();
    deleteBulkRQ.setIds(Lists.newArrayList(2L));
    mockMvc.perform(delete("/v1/user").with(token(oAuthHelper.getSuperadminToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(deleteBulkRQ))).andExpect(status().isOk());
}
Also used : DeleteBulkRQ(com.epam.ta.reportportal.ws.model.DeleteBulkRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 2 with DeleteBulkRQ

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

the class LaunchControllerTest method bulkDeleteLaunches.

@Test
void bulkDeleteLaunches() throws Exception {
    DeleteBulkRQ deleteBulkRQ = new DeleteBulkRQ();
    List<Long> ids = Lists.newArrayList(1L, 2L);
    deleteBulkRQ.setIds(ids);
    mockMvc.perform(delete(DEFAULT_PROJECT_BASE_URL + "/launch").contentType(APPLICATION_JSON).with(token(oAuthHelper.getDefaultToken())).content(objectMapper.writeValueAsBytes(deleteBulkRQ))).andExpect(status().is(200));
    List<Launch> launches = launchRepository.findAllById(ids);
    assertTrue(launches.isEmpty());
}
Also used : DeleteBulkRQ(com.epam.ta.reportportal.ws.model.DeleteBulkRQ) Launch(com.epam.ta.reportportal.entity.launch.Launch) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 3 with DeleteBulkRQ

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

the class ProjectControllerTest method bulkDeleteProjects.

@Test
void bulkDeleteProjects() throws Exception {
    DeleteBulkRQ bulkRQ = new DeleteBulkRQ();
    bulkRQ.setIds(Lists.newArrayList(2L, 3L));
    mockMvc.perform(delete("/v1/project").with(token(oAuthHelper.getSuperadminToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(bulkRQ))).andExpect(status().isOk());
}
Also used : DeleteBulkRQ(com.epam.ta.reportportal.ws.model.DeleteBulkRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Aggregations

BaseMvcTest (com.epam.ta.reportportal.ws.BaseMvcTest)3 DeleteBulkRQ (com.epam.ta.reportportal.ws.model.DeleteBulkRQ)3 Test (org.junit.jupiter.api.Test)3 Launch (com.epam.ta.reportportal.entity.launch.Launch)1