Commit bb91c28e authored by Matija Obreza's avatar Matija Obreza
Browse files

Removed test log clutter by MockMvcResultHandlers.print() calls

- Eclipse cleanup/formatting of source code
parent 0ad90ec7
......@@ -55,7 +55,7 @@ public abstract class AbstractDatasetControllerTest extends AbstractRestTest {
@Before
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(documentationConfiguration(restDocumentation).uris().withScheme("https").withHost(
"api.catalog.genesys-pgr.org").withPort(443)).build();
}
......@@ -68,12 +68,12 @@ public abstract class AbstractDatasetControllerTest extends AbstractRestTest {
super.cleanup();
}
protected Dataset setUpDataset(boolean published) {
protected Dataset setUpDataset(final boolean published) {
return setupDataset("Test Dataset Title", "Test Dataset Description", setUpPartner("Partner", true, "PartnerShortName", UUID.randomUUID()), published);
}
protected Dataset setupDataset(String title, String description, Partner owner, boolean published) {
Dataset input = new Dataset();
protected Dataset setupDataset(final String title, final String description, final Partner owner, final boolean published) {
final Dataset input = new Dataset();
input.setTitle(title);
input.setDescription(description);
input.setOwner(owner);
......@@ -82,8 +82,8 @@ public abstract class AbstractDatasetControllerTest extends AbstractRestTest {
return input;
}
protected Partner setUpPartner(String name, boolean isActive, String shortName, UUID uuid) {
Partner partner = new Partner();
protected Partner setUpPartner(final String name, final boolean isActive, final String shortName, final UUID uuid) {
final Partner partner = new Partner();
partner.setName(name);
partner.setActive(isActive);
partner.setShortName(shortName);
......@@ -95,7 +95,7 @@ public abstract class AbstractDatasetControllerTest extends AbstractRestTest {
protected Descriptor setUpDescriptor() {
Descriptor descriptor = new Descriptor();
final Descriptor descriptor = new Descriptor();
descriptor.setUuid(UUID.randomUUID());
descriptor.setCategory(Descriptor.Category.PASSPORT);
descriptor.setDataType(Descriptor.DataType.BOOLEAN);
......
......@@ -16,6 +16,15 @@
package org.genesys.catalog.server.controller.api.v0;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertNull;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.genesys.catalog.server.controller.rest.AbstractRestTest;
import org.genesys.catalog.server.controller.rest.WithMockOAuth2Authentication;
import org.genesys.common.model.Crop;
......@@ -27,53 +36,43 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.WebApplicationContext;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.junit.Assert.assertNull;
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.documentationConfiguration;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* @author Maxym Borodenko
*/
public class CropsControllerTest extends AbstractRestTest {
private static final String CROP_TITLE = "Title value";
private static final String CROP_CODE = "Code value";
private static final String CROP_TITLE = "Title value";
private static final String CROP_CODE = "Code value";
@Autowired
private CropRepository cropRepository;
@Autowired
private WebApplicationContext webApplicationContext;
@Autowired
private CropRepository cropRepository;
@Autowired
private WebApplicationContext webApplicationContext;
private MockMvc mockMvc;
private MockMvc mockMvc;
@Before
@Transactional
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(documentationConfiguration(restDocumentation).uris().withScheme("https").withHost(
"api.catalog.genesys-pgr.org").withPort(443)).build();
}
@Before
@Transactional
public void setUp() {
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).apply(documentationConfiguration(restDocumentation).uris().withScheme("https").withHost(
"api.catalog.genesys-pgr.org").withPort(443)).build();
}
@After
@Override
public void cleanup() {
cropRepository.deleteAll();
super.cleanup();
}
@After
@Override
public void cleanup() {
cropRepository.deleteAll();
super.cleanup();
}
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" })
public void createCropTest() throws Exception {
String s = verboseMapper.writeValueAsString(setUpCrop());
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" })
public void createCropTest() throws Exception {
final String s = verboseMapper.writeValueAsString(setUpCrop());
/*@formatter:off*/
mockMvc
......@@ -86,15 +85,15 @@ public class CropsControllerTest extends AbstractRestTest {
.andExpect(jsonPath("$.code", is(CROP_CODE)))
.andExpect(jsonPath("$.title", is(CROP_TITLE)));
/*@formatter:on*/
}
}
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" })
public void updateCropTest() throws Exception {
Crop crop = cropRepository.save(setUpCrop());
crop.setTitle("Test title 2");
crop.setCode("Test code 2");
String s = verboseMapper.writeValueAsString(crop);
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" })
public void updateCropTest() throws Exception {
final Crop crop = cropRepository.save(setUpCrop());
crop.setTitle("Test title 2");
crop.setCode("Test code 2");
final String s = verboseMapper.writeValueAsString(crop);
/*@formatter:off*/
mockMvc
......@@ -103,7 +102,7 @@ public class CropsControllerTest extends AbstractRestTest {
.post(CropsController.API_BASE + "/update")
.content(s)
.contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())))
......@@ -111,12 +110,12 @@ public class CropsControllerTest extends AbstractRestTest {
.andExpect(jsonPath("$.code", is(crop.getCode())))
.andExpect(jsonPath("$.uuid", is(crop.getUuid().toString())));
/*@formatter:on*/
}
}
@Test
@WithMockOAuth2Authentication()
public void getCropTest() throws Exception {
Crop crop = cropRepository.save(setUpCrop());
@Test
@WithMockOAuth2Authentication()
public void getCropTest() throws Exception {
final Crop crop = cropRepository.save(setUpCrop());
/*@formatter:off*/
mockMvc
......@@ -126,12 +125,12 @@ public class CropsControllerTest extends AbstractRestTest {
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())));
/*@formatter:on*/
}
}
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" })
public void listCropsTest() throws Exception {
createCropTest();
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" })
public void listCropsTest() throws Exception {
createCropTest();
/*@formatter:off*/
mockMvc
......@@ -145,12 +144,12 @@ public class CropsControllerTest extends AbstractRestTest {
.andExpect(jsonPath("$.[0].title", not(nullValue())))
.andExpect(jsonPath("$.[0].code", not(nullValue())));
/*@formatter:on*/
}
}
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" })
public void deleteCropTest() throws Exception {
final Crop crop = cropRepository.save(setUpCrop());
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" })
public void deleteCropTest() throws Exception {
final Crop crop = cropRepository.save(setUpCrop());
/*@formatter:off*/
mockMvc
......@@ -162,13 +161,13 @@ public class CropsControllerTest extends AbstractRestTest {
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8));
/*@formatter:on*/
assertNull(cropRepository.getByUuid(crop.getUuid()));
}
assertNull(cropRepository.getByUuid(crop.getUuid()));
}
private Crop setUpCrop() {
final Crop crop = new Crop();
crop.setCode(CROP_CODE);
crop.setTitle(CROP_TITLE);
return crop;
}
private Crop setUpCrop() {
final Crop crop = new Crop();
crop.setCode(CROP_CODE);
crop.setTitle(CROP_TITLE);
return crop;
}
}
......@@ -38,7 +38,6 @@ import org.junit.Test;
import org.springframework.http.MediaType;
import org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
/**
* @author Andrey Lugovskoy.
......@@ -74,7 +73,7 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
.perform(post(DatasetController.API_BASE.concat("/publish"))
.param("uuid", dataset.getUuid().toString())
.param("version", dataset.getVersion().toString()))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())))
......@@ -96,7 +95,7 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
.perform(post(DatasetController.API_BASE.concat("/publish"))
.param("uuid", dataset.getUuid().toString())
.param("version", dataset.getVersion().toString()))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(jsonPath("$.published", is(true)))
// .andExpect(jsonPath("$.version", is(dataset.getVersion() + 1)))
......@@ -107,7 +106,7 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
.param("uuid", dataset.getUuid().toString())
.param("version", "" + (dataset.getVersion() + 1))
.param("published", "false"))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(jsonPath("$.published", is(false)));
/*@formatter:on*/
......@@ -121,7 +120,7 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
mockMvc
.perform(RestDocumentationRequestBuilders.get(DatasetController.API_BASE.concat("/{UUID}"), UUID.randomUUID())
.accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isNotFound());
/*@formatter:on*/
}
......@@ -129,15 +128,15 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
@Test
@WithMockUser(username = "user", password = "user", roles = "ADMINISTRATOR")
public void listDataset() throws Exception {
DatasetFilter datasetFilter = new DatasetFilter();
PartnerFilter partnerFilter = new PartnerFilter();
final DatasetFilter datasetFilter = new DatasetFilter();
final PartnerFilter partnerFilter = new PartnerFilter();
partnerFilter.shortName = new HashSet<>();
partnerFilter.shortName.add("PartnerShortNameTwo");
datasetFilter.owner = partnerFilter;
Dataset dataset = datasetService.createDataset(setUpDataset(false));
Dataset dataset2 = datasetService.createDataset(setupDataset("Test Dataset Title Two", "Test Dataset Description Two", setUpPartner("PartnerTwo", true, "PartnerShortNameTwo",
UUID.randomUUID()), true));
datasetService.createDataset(setUpDataset(false));
final Dataset dataset2 = datasetService.createDataset(setupDataset("Test Dataset Title Two", "Test Dataset Description Two", setUpPartner("PartnerTwo", true,
"PartnerShortNameTwo", UUID.randomUUID()), true));
/*@formatter:off*/
mockMvc
......@@ -155,9 +154,9 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
@Test
@WithMockUser(username = "user", password = "user", roles = "ADMINISTRATOR")
public void createDataset() throws Exception {
Dataset dataset = setUpDataset(false);
final Dataset dataset = setUpDataset(false);
String s = verboseMapper.writeValueAsString(dataset);
final String s = verboseMapper.writeValueAsString(dataset);
/*@formatter:off*/
mockMvc
......@@ -176,9 +175,9 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
@WithMockUser(username = "user", password = "user", roles = "ADMINISTRATOR")
public void updateDescriptorListTest() throws Exception {
Dataset dataset = datasetService.createDataset(setUpDataset(false));
final Dataset dataset = datasetService.createDataset(setUpDataset(false));
dataset.setTitle("Title 2");
String s = verboseMapper.writeValueAsString(dataset);
final String s = verboseMapper.writeValueAsString(dataset);
/*@formatter:off*/
mockMvc
......@@ -186,7 +185,7 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
.content(s)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())))
......@@ -198,11 +197,16 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
@Test
@WithMockUser(username = "user", password = "user", roles = "ADMINISTRATOR")
public void upsertAccessions() throws Exception {
Dataset dataset = datasetService.createDataset(setUpDataset(false));
final Dataset dataset = datasetService.createDataset(setUpDataset(false));
final Set<AccessionIdentifier> accessionIdentifiers = new HashSet<AccessionIdentifier>() {
/**
*
*/
private static final long serialVersionUID = 6718121172547984782L;
Set<AccessionIdentifier> accessionIdentifiers = new HashSet<AccessionIdentifier>() {
{
AccessionIdentifier accessionIdentifier = new AccessionIdentifier();
final AccessionIdentifier accessionIdentifier = new AccessionIdentifier();
accessionIdentifier.setAcceNumb("TestAccNum");
accessionIdentifier.setGenus("TestGen");
accessionIdentifier.setInstCode("InstCode");
......@@ -210,7 +214,7 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
}
};
String s = verboseMapper.writeValueAsString(accessionIdentifiers);
final String s = verboseMapper.writeValueAsString(accessionIdentifiers);
/*@formatter:off*/
mockMvc
......@@ -218,7 +222,7 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
.content(s)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())))
......@@ -231,11 +235,11 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
@Test
@WithMockUser(username = "user", password = "user", roles = "ADMINISTRATOR")
public void addDescriptorTest() throws Exception {
Dataset dataset = datasetService.createDataset(setUpDataset(false));
final Dataset dataset = datasetService.createDataset(setUpDataset(false));
Descriptor descriptor = descriptorRepository.save(setUpDescriptor());
final Descriptor descriptor = descriptorRepository.save(setUpDescriptor());
String s = verboseMapper.writeValueAsString(new UUID[] { descriptor.getUuid() });
final String s = verboseMapper.writeValueAsString(new UUID[] { descriptor.getUuid() });
/*@formatter:off*/
mockMvc
......@@ -243,7 +247,7 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
.content(s)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())))
......@@ -256,11 +260,11 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
@Test
@WithMockUser(username = "user", password = "user", roles = "ADMINISTRATOR")
public void removeDescriptorTest() throws Exception {
Descriptor descriptor = descriptorRepository.save(setUpDescriptor());
final Descriptor descriptor = descriptorRepository.save(setUpDescriptor());
Dataset dataset = datasetService.createDataset(setUpDataset(false));
dataset = datasetService.addDescriptors(dataset, descriptor);
String s = verboseMapper.writeValueAsString(new UUID[] { descriptor.getUuid() });
final String s = verboseMapper.writeValueAsString(new UUID[] { descriptor.getUuid() });
/*@formatter:off*/
mockMvc
......@@ -268,7 +272,7 @@ public class DatasetControllerTest extends AbstractDatasetControllerTest {
.content(s)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())))
......
......@@ -25,7 +25,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import org.genesys.catalog.model.dataset.Dataset;
import org.genesys.catalog.model.dataset.DatasetCreator;
import org.genesys.catalog.persistence.dataset.DatasetCreatorRepository;
import org.genesys.catalog.server.controller.rest.WithMockOAuth2Authentication;
import org.genesys.catalog.service.DatasetCreatorService;
import org.junit.After;
......@@ -34,20 +33,16 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders;
import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.web.servlet.result.MockMvcResultHandlers;
/**
* @author Andrey Lugovskoy.
*/
@WithMockUser(username = "user", password = "user" , roles = "USER")
@WithMockUser(username = "user", password = "user", roles = "USER")
public class DatasetCreatorControllerTest extends AbstractDatasetControllerTest {
@Autowired
private DatasetCreatorService datasetCreatorService;
@Autowired
private DatasetCreatorRepository datasetCreatorRepository;
@After
@Override
public void cleanup() {
......@@ -57,71 +52,79 @@ public class DatasetCreatorControllerTest extends AbstractDatasetControllerTest
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" }, scopes = { "write" })
public void listDatasetCreators() throws Exception {
Dataset dataset = datasetService.createDataset(setUpDataset(false));
DatasetCreator datasetCreator = buildDatasetCreator("TestFullName", "TestEmailName", "0673579007", dataset);
DatasetCreator creator = datasetCreatorService.createDatasetCreator(dataset.getUuid(), datasetCreator);
final Dataset dataset = datasetService.createDataset(setUpDataset(false));
final DatasetCreator datasetCreator = buildDatasetCreator("TestFullName", "TestEmailName", "0673579007", dataset);
final DatasetCreator creator = datasetCreatorService.createDatasetCreator(dataset.getUuid(), datasetCreator);
/*@formatter:off*/
this.mockMvc.perform(RestDocumentationRequestBuilders.get(DatasetCreatorController.API_BASE.concat("/list"), dataset.getUuid()))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$.content[0]", not(nullValue())))
.andExpect(jsonPath("$.content[0].id", is(creator.getId().intValue())));
/*@formatter:on*/
}
@Test
public void loadByUuid() throws Exception {
Dataset dataset = datasetService.createDataset(setUpDataset(true));
DatasetCreator datasetCreator = buildDatasetCreator("TestFullName", "TestEmailName", "0673579007", dataset);
DatasetCreator creator = datasetCreatorService.createDatasetCreator(dataset.getUuid(), datasetCreator);
final Dataset dataset = datasetService.createDataset(setUpDataset(true));
final DatasetCreator datasetCreator = buildDatasetCreator("TestFullName", "TestEmailName", "0673579007", dataset);
final DatasetCreator creator = datasetCreatorService.createDatasetCreator(dataset.getUuid(), datasetCreator);
/*@formatter:off*/
this.mockMvc.perform(RestDocumentationRequestBuilders.get(DatasetCreatorController.API_BASE.concat("/{creatorUuid}"), dataset.getUuid(),
creator.getUuid()))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.id", is(creator.getId().intValue())));
/*@formatter:on*/
}
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" }, scopes = { "write" })
public void createDatasetCreator() throws Exception {
Dataset dataset = datasetService.createDataset(setUpDataset(false));
DatasetCreator datasetCreator = buildDatasetCreator("TestFullName", "TestEmailName", "0673579007", dataset);
final Dataset dataset = datasetService.createDataset(setUpDataset(false));
final DatasetCreator datasetCreator = buildDatasetCreator("TestFullName", "TestEmailName", "0673579007", dataset);
String s = verboseMapper.writeValueAsString(datasetCreator);
final String s = verboseMapper.writeValueAsString(datasetCreator);
/*@formatter:off*/
mockMvc.perform(RestDocumentationRequestBuilders.post(DatasetCreatorController.API_BASE + "/create", dataset.getUuid())
.content(s)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andExpect(jsonPath("$", not(nullValue())))
.andExpect(jsonPath("$.fullName", equalTo(datasetCreator.getFullName())));
/*@formatter:on*/
}
@Test
@WithMockOAuth2Authentication(roles = { "ADMINISTRATOR" }, scopes = { "write" })
public void deleteDatasetCreator() throws Exception {
Dataset dataset = datasetService.createDataset(setUpDataset(false));
DatasetCreator datasetCreator = buildDatasetCreator("TestFullName", "TestEmailName", "0673579007", dataset);
DatasetCreator creator = datasetCreatorService.createDatasetCreator(dataset.getUuid(), datasetCreator);
String s = verboseMapper.writeValueAsString(creator);
final Dataset dataset = datasetService.createDataset(setUpDataset(false));
final DatasetCreator datasetCreator = buildDatasetCreator("TestFullName", "TestEmailName", "0673579007", dataset);
final DatasetCreator creator = datasetCreatorService.createDatasetCreator(dataset.getUuid(), datasetCreator);
final String s = verboseMapper.writeValueAsString(creator);
/*@formatter:off*/
mockMvc.perform(RestDocumentationRequestBuilders.delete(DatasetCreatorController.API_BASE + "/delete",
dataset.getUuid(), creator.getUuid())
.content(s)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultHandlers.print())
// .andDo(MockMvcResultHandlers.print())
.andExpect(status().isOk());
/*@formatter:on*/
}
protected DatasetCreator buildDatasetCreator(String fullName, String email, St