Search in sources :

Example 1 with CreatePaperDTO

use of com.odysseusinc.arachne.portal.api.v1.dto.CreatePaperDTO in project ArachneCentralAPI by OHDSI.

the class BasePaperControllerTest method testCreatePaper.

@Test
@WithUserDetails(value = ADMIN_EMAIL)
@ExpectedDatabase(value = "/data/paper/papers-after-creation.xml", assertionMode = NON_STRICT)
public void testCreatePaper() throws Exception {
    final CreatePaperDTO createPaperDTO = new CreatePaperDTO();
    createPaperDTO.setStudyId(1L);
    MvcResult mvcResult = mvc.perform(post("/api/v1/papers").contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(createPaperDTO))).andExpect(OK_STATUS).andReturn();
}
Also used : CreatePaperDTO(com.odysseusinc.arachne.portal.api.v1.dto.CreatePaperDTO) MvcResult(org.springframework.test.web.servlet.MvcResult) ExpectedDatabase(com.github.springtestdbunit.annotation.ExpectedDatabase) Test(org.junit.Test) WithUserDetails(org.springframework.security.test.context.support.WithUserDetails)

Aggregations

ExpectedDatabase (com.github.springtestdbunit.annotation.ExpectedDatabase)1 CreatePaperDTO (com.odysseusinc.arachne.portal.api.v1.dto.CreatePaperDTO)1 Test (org.junit.Test)1 WithUserDetails (org.springframework.security.test.context.support.WithUserDetails)1 MvcResult (org.springframework.test.web.servlet.MvcResult)1