Commit 9738dead authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

feat tu

parent 1810380f
...@@ -89,11 +89,11 @@ public class PuaPastisValidator { ...@@ -89,11 +89,11 @@ public class PuaPastisValidator {
private JSONObject getProfileJsonExpected(boolean standalone) { private JSONObject getProfileJsonExpected(boolean standalone) {
if (profileJsonExpected == null) { if (profileJsonExpected == null) {
InputStream inputStream; InputStream inputStream;
if(standalone) if (standalone)
inputStream = getClass().getClassLoader().getResourceAsStream("pua_validation/valid_pua.json"); inputStream = getClass().getClassLoader().getResourceAsStream("pua_validation/valid_pua.json");
else{ else {
inputStream = getClass().getClassLoader().getResourceAsStream("pua_validation/valid_pua_vitam.json"); inputStream = getClass().getClassLoader().getResourceAsStream("pua_validation/valid_pua_vitam.json");
} }
assert inputStream != null; assert inputStream != null;
JSONTokener tokener = new JSONTokener(new InputStreamReader(inputStream)); JSONTokener tokener = new JSONTokener(new InputStreamReader(inputStream));
...@@ -138,20 +138,20 @@ public class PuaPastisValidator { ...@@ -138,20 +138,20 @@ public class PuaPastisValidator {
// Compare list of field at the root level // Compare list of field at the root level
if (!standalone) { if (!standalone) {
Set<String> actualFieldList = pua.keySet().stream().collect(toSet()); Set<String> actualFieldList = pua.keySet().stream().collect(toSet());
if(!actualFieldList.contains("name") && !actualFieldList.contains("controlSchema")){ if (!actualFieldList.contains("name") && !actualFieldList.contains("controlSchema")) {
throw new AssertionError("Notice not contains the expected keys 'name' and 'controlSchema'"); throw new AssertionError("Notice not contains the expected keys 'name' and 'controlSchema'");
} }
} }
// Next tests are controlling the ControlSchema // Next tests are controlling the ControlSchema
String controlSchemaString = pua.getString(CONTROLSCHEMA); String controlSchemaString = pua.getString(CONTROLSCHEMA);
JSONObject controlSchemaActual = new JSONObject(controlSchemaString); JSONObject controlSchemaActual = new JSONObject(controlSchemaString);
controlSchemaString = profileJson.getString(CONTROLSCHEMA); controlSchemaString = profileJson.getString(CONTROLSCHEMA);
JSONObject controlSchemaExpected = new JSONObject(controlSchemaString); JSONObject controlSchemaExpected = new JSONObject(controlSchemaString);
LOGGER.error(controlSchemaActual.toString() + " control schema actuelle"); LOGGER.error(controlSchemaActual.toString() + " control schema actuelle");
LOGGER.error(controlSchemaExpected.toString() + " control schema Expected"); LOGGER.error(controlSchemaExpected.toString() + " control schema Expected");
if(standalone) { if (standalone) {
// Checking that the whole structure is respected. Doesn't care that the pua contains extended fields. // Checking that the whole structure is respected. Doesn't care that the pua contains extended fields.
//JSONAssert.assertEquals(controlSchemaExpected, controlSchemaActual, JSONCompareMode.LENIENT); //JSONAssert.assertEquals(controlSchemaExpected, controlSchemaActual, JSONCompareMode.LENIENT);
...@@ -159,37 +159,41 @@ public class PuaPastisValidator { ...@@ -159,37 +159,41 @@ public class PuaPastisValidator {
// JSONAssert.assertEquals(controlSchemaExpected.getJSONObject(DEFINITIONS), // JSONAssert.assertEquals(controlSchemaExpected.getJSONObject(DEFINITIONS),
// controlSchemaActual.getJSONObject(DEFINITIONS), JSONCompareMode.STRICT); // controlSchemaActual.getJSONObject(DEFINITIONS), JSONCompareMode.STRICT);
// Checking that additionalProperties is present and is boolean // Checking that additionalProperties is present and is boolean
if (controlSchemaActual.has("additionalProperties") && if (controlSchemaActual.has("additionalProperties") &&
!(controlSchemaActual.get("additionalProperties") instanceof Boolean)) { !(controlSchemaActual.get("additionalProperties") instanceof Boolean)) {
throw new AssertionError("PUA additionalProperties field does not contains a boolean value"); throw new AssertionError("PUA additionalProperties field does not contains a boolean value");
} }
// Checking that #management object is present and at the correct position // Checking that #management object is present and at the correct position
if (controlSchemaActual.has("patternProperties")) { if (controlSchemaActual.has("patternProperties")) {
JSONObject patternProperties = controlSchemaActual.getJSONObject("patternProperties"); JSONObject patternProperties = controlSchemaActual.getJSONObject("patternProperties");
if (patternProperties.has(MANAGEMENTCONTROL)) { if (patternProperties.has(MANAGEMENTCONTROL)) {
JSONAssert.assertEquals(new JSONObject(), patternProperties.getJSONObject(MANAGEMENTCONTROL), JSONAssert.assertEquals(new JSONObject(), patternProperties.getJSONObject(MANAGEMENTCONTROL),
JSONCompareMode.STRICT); JSONCompareMode.STRICT);
// Check that #management is not in both header and 'properties' object // Check that #management is not in both header and 'properties' object
JSONObject properties = controlSchemaActual.getJSONObject(PROPERTIES); JSONObject properties = controlSchemaActual.getJSONObject(PROPERTIES);
if (properties.has(MANAGEMENTCONTROL)) { if (properties.has(MANAGEMENTCONTROL)) {
throw new AssertionError("Can't have both '#management' key in header and in 'properties' object"); throw new AssertionError("Can't have both '#management' key in header and in 'properties' object");
}
}
} else {
if (controlSchemaActual.has(PROPERTIES)) {
JSONObject properties = controlSchemaActual.getJSONObject(PROPERTIES);
if (!properties.has(MANAGEMENTCONTROL)) {
throw new AssertionError("Missing '#management' key in 'properties' object");
}
} else {
throw new AssertionError("Missing 'properties' key in controlShema");
} }
// #HAVEFUN
} }
} else { } else {
JSONObject properties = controlSchemaActual.getJSONObject(PROPERTIES); if (!controlSchemaActual.has(SCHEMA)) {
if (!properties.has(MANAGEMENTCONTROL)) { throw new AssertionError("Missing '$schema' key in controlSchema' object");
throw new AssertionError("Missing '#management' key in 'properties' object");
} }
// #HAVEFUN
}
} }
else{
if (!controlSchemaActual.has(SCHEMA)) {
throw new AssertionError("Missing '$schema' key in controlSchema' object");
}
}
} }
public JSONObject getDefinitionsFromExpectedProfile() { public JSONObject getDefinitionsFromExpectedProfile() {
...@@ -228,11 +232,11 @@ public class PuaPastisValidator { ...@@ -228,11 +232,11 @@ public class PuaPastisValidator {
String sedaName = sedaElement.getName(); String sedaName = sedaElement.getName();
String sedaCardinality = sedaElement.getCardinality(); String sedaCardinality = sedaElement.getCardinality();
if(sedaName.equals("algorithm")){ if (sedaName.equals("algorithm")) {
return "string"; return "string";
} }
if(sedaName.equals("Title") || sedaName.equals("Description")) { if (sedaName.equals("Title") || sedaName.equals("Description")) {
if (element.getCardinality().equals("1")) { if (element.getCardinality().equals("1")) {
return "string"; return "string";
} else { } else {
...@@ -251,7 +255,7 @@ public class PuaPastisValidator { ...@@ -251,7 +255,7 @@ public class PuaPastisValidator {
if (sedaType.equals("boolean") && (sedaCardinality.equals("0-1") || sedaCardinality.equals("1"))) { if (sedaType.equals("boolean") && (sedaCardinality.equals("0-1") || sedaCardinality.equals("1"))) {
return "boolean"; return "boolean";
} }
if (sedaType.equals("integer")&& (sedaCardinality.equals("0-1") || sedaCardinality.equals("1"))) { if (sedaType.equals("integer") && (sedaCardinality.equals("0-1") || sedaCardinality.equals("1"))) {
return "integer"; return "integer";
} }
if (sedaCardinality.equals("1-N") || sedaCardinality.equals("0-N")) { if (sedaCardinality.equals("1-N") || sedaCardinality.equals("0-N")) {
...@@ -303,7 +307,7 @@ public class PuaPastisValidator { ...@@ -303,7 +307,7 @@ public class PuaPastisValidator {
"ReuseRule", "ClassificationRule"); "ReuseRule", "ClassificationRule");
for (ElementProperties el : elementsFromTree) { for (ElementProperties el : elementsFromTree) {
setMetadataName(el); setMetadataName(el);
try { try {
if (el.getName().equals(MANAGEMENT)) { if (el.getName().equals(MANAGEMENT)) {
JSONObject management = getJSONFromManagement(el); JSONObject management = getJSONFromManagement(el);
...@@ -368,7 +372,7 @@ public class PuaPastisValidator { ...@@ -368,7 +372,7 @@ public class PuaPastisValidator {
* @throws IOException * @throws IOException
*/ */
private void retrieveAccumalatedJsonManagaementProperties(ElementProperties element, List<String> rulesMetadata, private void retrieveAccumalatedJsonManagaementProperties(ElementProperties element, List<String> rulesMetadata,
List<String> childrenToEncapsulate, List<String> rulesFound, JSONObject pua) throws IOException { List<String> childrenToEncapsulate, List<String> rulesFound, JSONObject pua) throws IOException {
for (ElementProperties childElement : element.getChildren()) { for (ElementProperties childElement : element.getChildren()) {
JSONObject childrenOfRule = sortedJSON(); JSONObject childrenOfRule = sortedJSON();
JSONObject grandChildrenOfRule = sortedJSON(); JSONObject grandChildrenOfRule = sortedJSON();
...@@ -437,7 +441,7 @@ public class PuaPastisValidator { ...@@ -437,7 +441,7 @@ public class PuaPastisValidator {
* @return * @return
*/ */
private boolean checkSpecialCases(List<String> rulesMetadata, List<String> rulesFound, private boolean checkSpecialCases(List<String> rulesMetadata, List<String> rulesFound,
ElementProperties childElement, SedaNode sedaElement) { ElementProperties childElement, SedaNode sedaElement) {
if (!rulesMetadata.contains(childElement.getName()) || sedaElement == null) { if (!rulesMetadata.contains(childElement.getName()) || sedaElement == null) {
return true; return true;
} }
...@@ -455,7 +459,7 @@ public class PuaPastisValidator { ...@@ -455,7 +459,7 @@ public class PuaPastisValidator {
* @param ruleTypeMetadata * @param ruleTypeMetadata
*/ */
private void putRequiredNonSpecialChildren(ElementProperties childElement, List<String> requiredNonSpecialChildren, private void putRequiredNonSpecialChildren(ElementProperties childElement, List<String> requiredNonSpecialChildren,
JSONObject ruleTypeMetadata) { JSONObject ruleTypeMetadata) {
if (!requiredNonSpecialChildren.isEmpty()) { if (!requiredNonSpecialChildren.isEmpty()) {
ruleTypeMetadata.getJSONObject(childElement.getName()) ruleTypeMetadata.getJSONObject(childElement.getName())
.put(REQUIRED, requiredNonSpecialChildren); .put(REQUIRED, requiredNonSpecialChildren);
...@@ -471,7 +475,7 @@ public class PuaPastisValidator { ...@@ -471,7 +475,7 @@ public class PuaPastisValidator {
* @param requiredChildren * @param requiredChildren
*/ */
private void putChildrenIntoRules(JSONObject childrenOfRule, JSONObject grandChildrenOfRule, private void putChildrenIntoRules(JSONObject childrenOfRule, JSONObject grandChildrenOfRule,
JSONObject propertiesRules, List<String> requiredChildren) { JSONObject propertiesRules, List<String> requiredChildren) {
if (!grandChildrenOfRule.isEmpty()) { if (!grandChildrenOfRule.isEmpty()) {
JSONObject propretyOfItems = new JSONObject().put(ADDITIONAL_PROPERTIES, false); JSONObject propretyOfItems = new JSONObject().put(ADDITIONAL_PROPERTIES, false);
propretyOfItems.put(PROPERTIES, grandChildrenOfRule); propretyOfItems.put(PROPERTIES, grandChildrenOfRule);
...@@ -493,8 +497,8 @@ public class PuaPastisValidator { ...@@ -493,8 +497,8 @@ public class PuaPastisValidator {
* @throws JsonProcessingException * @throws JsonProcessingException
*/ */
private void childrenContainsGrandChildName(JSONObject grandChildrenOfRule, private void childrenContainsGrandChildName(JSONObject grandChildrenOfRule,
PuaMetadataDetails ruleTypeMetadataDetails, List<String> requiredChildren, ElementProperties grandChild, PuaMetadataDetails ruleTypeMetadataDetails, List<String> requiredChildren, ElementProperties grandChild,
SedaNode node) throws JsonProcessingException { SedaNode node) throws JsonProcessingException {
PuaMetadataDetails childOfRuleDetails = new PuaMetadataDetails(); PuaMetadataDetails childOfRuleDetails = new PuaMetadataDetails();
getMetaDataFromSeda(grandChild, childOfRuleDetails, node); getMetaDataFromSeda(grandChild, childOfRuleDetails, node);
if (grandChild.getCardinality().equals("1")) if (grandChild.getCardinality().equals("1"))
...@@ -511,7 +515,7 @@ public class PuaPastisValidator { ...@@ -511,7 +515,7 @@ public class PuaPastisValidator {
* Retrieve the accumulated JSONArray properties from pua * Retrieve the accumulated JSONArray properties from pua
* *
* @param pua is JSONObjet that contains Management section of PUA * @param pua is JSONObjet that contains Management section of PUA
* Convert it into a JSONObject and put it into a #mangagement key * Convert it into a JSONObject and put it into a #mangagement key
*/ */
public JSONObject retrieveAccumulatedJsonManagementProperties(JSONObject pua) { public JSONObject retrieveAccumulatedJsonManagementProperties(JSONObject pua) {
...@@ -555,7 +559,7 @@ public class PuaPastisValidator { ...@@ -555,7 +559,7 @@ public class PuaPastisValidator {
.getChildren().stream().filter(childName -> childName.getName().equals(elementName)).findAny().orElse(null); .getChildren().stream().filter(childName -> childName.getName().equals(elementName)).findAny().orElse(null);
} else { } else {
result = sedaTree.flattened() result = sedaTree.flattened()
.filter(e -> e.getName().equals(elementName) ).findAny().orElse(null); .filter(e -> e.getName().equals(elementName)).findAny().orElse(null);
} }
return result; return result;
} }
......
...@@ -52,7 +52,6 @@ public class PuaPastisValidatorNOKTest { ...@@ -52,7 +52,6 @@ public class PuaPastisValidatorNOKTest {
@Parameters @Parameters
public static Collection<String> data() { public static Collection<String> data() {
return Arrays.asList(new String[] { return Arrays.asList(new String[] {
"pua/pua_NOK_missing_definitions.json",
"pua/pua_NOK_missing_management.json", "pua/pua_NOK_missing_management.json",
"pua/pua_NOK_missing_properties.json", "pua/pua_NOK_missing_properties.json",
"pua/pua_NOK_both_management_present.json" "pua/pua_NOK_both_management_present.json"
......
...@@ -165,7 +165,7 @@ public class PastisService { ...@@ -165,7 +165,7 @@ public class PastisService {
try { try {
return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(notice); return objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(notice);
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
throw new TechnicalException("Problems durint conversion objectMapper to string", e); throw new TechnicalException("Problems during conversion objectMapper to string", e);
} }
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"lastUpdate": "2020-11-26T14:08:20.987", "lastUpdate": "2020-11-26T14:08:20.987",
"activationDate": "2016-12-10T00:00:00.000", "activationDate": "2016-12-10T00:00:00.000",
"deactivationDate": "2016-12-10T00:00:00.000", "deactivationDate": "2016-12-10T00:00:00.000",
"controlSchema": "{\"$schema\":\"http://json-schema.org/draft-04/schema\",\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"#management\":{}},\"required\":[\"ArchiveUnitProfile\",\"DescriptionLevel\",\"Title_\",\"#management\"],\"definitions\":{\"pattern-simple-date\":{\"type\":\"string\",\"pattern\":\"[0-9]{4}-[0-9]{2}-[0-9]{2}\"},\"pattern-date\":{\"type\":\"string\",\"pattern\":\"^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$\"}},\"properties\":{{\"#management\":{\"additionalProperties\": false},\"ArchiveUnitProfile\":{\"type\":\"string\",\"description\":\"Identifiant du PUA : cardinalité 1\"},\"DescriptionLevel\":{\"type\":\"string\",\"description\":\"Niveau de description : cardinalité 1\"},\"Title_\":{\"type\":\"object\",\"description\":\"Titre de la ressource : cardinalité 1-N\"}}}", "controlSchema": "{\"$schema\":\"http://json-schema.org/draft-04/schema\",\"type\":\"object\",\"additionalProperties\":false,\"patternProperties\":{\"#management\":{}},\"required\":[\"ArchiveUnitProfile\",\"DescriptionLevel\",\"Title_\",\"#management\"],\"definitions\":{\"pattern-simple-date\":{\"type\":\"string\",\"pattern\":\"[0-9]{4}-[0-9]{2}-[0-9]{2}\"},\"pattern-date\":{\"type\":\"string\",\"pattern\":\"^([0-8][0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01]))$\"}},\"properties\":{\"#management\":{\"additionalProperties\": false},\"ArchiveUnitProfile\":{\"type\":\"string\",\"description\":\"Identifiant du PUA : cardinalité 1\"},\"DescriptionLevel\":{\"type\":\"string\",\"description\":\"Niveau de description : cardinalité 1\"},\"Title_\":{\"type\":\"object\",\"description\":\"Titre de la ressource : cardinalité 1-N\"}}}",
"tenant": 8, "tenant": 8,
"version": 1, "version": 1,
"fields": [ "fields": [
......
package fr.gouv.vitamui.pastis.server.rest;
import fr.gouv.vitamui.commons.api.domain.IdDto;
import fr.gouv.vitamui.commons.api.domain.ServicesData;
import fr.gouv.vitamui.commons.api.logger.VitamUILogger;
import fr.gouv.vitamui.commons.rest.client.ExternalHttpContext;
import fr.gouv.vitamui.commons.security.client.dto.AuthUserDto;
import fr.gouv.vitamui.commons.test.rest.AbstractMockMvcCrudControllerTest;
import fr.gouv.vitamui.commons.test.rest.AbstractRestControllerMockMvcTest;
import fr.gouv.vitamui.iam.security.authentication.ExternalAuthentication;
import fr.gouv.vitamui.iam.security.provider.ExternalApiAuthenticationProvider;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.security.core.Authentication;
import java.util.List;
public abstract class ControllerTest extends AbstractRestControllerMockMvcTest {
@MockBean
private ExternalApiAuthenticationProvider apiAuthenticationProvider;
@Override
protected Authentication buildUserAuthenticated() {
final Authentication authentication = new ExternalAuthentication(buildPrincipal(), buildCredentials(),null,buildUserRoles());
return authentication;
}
protected AuthUserDto buildPrincipal() {
final AuthUserDto user = new AuthUserDto();
user.setFirstname("test");
return user;
}
protected ExternalHttpContext buildCredentials() {
return null;
}
protected List<String> buildUserRoles() {
return ServicesData.getServicesByName(getServices());
}
protected abstract String[] getServices();
}
package fr.gouv.vitamui.pastis.server.rest;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.collect.ImmutableMap;
import fr.gouv.vitamui.commons.api.domain.IdDto;
import fr.gouv.vitamui.commons.api.domain.ServicesData;
import fr.gouv.vitamui.commons.api.identity.ServerIdentityConfiguration;
import fr.gouv.vitamui.commons.api.logger.VitamUILogger;
import fr.gouv.vitamui.commons.api.logger.VitamUILoggerFactory;
import fr.gouv.vitamui.commons.rest.RestExceptionHandler;
import fr.gouv.vitamui.commons.test.rest.AbstractRestControllerMockMvcTest;
import fr.gouv.vitamui.iam.security.provider.ExternalApiAuthenticationProvider;
import fr.gouv.vitamui.pastis.common.dto.ElementProperties;
import fr.gouv.vitamui.pastis.common.dto.profiles.Notice;
import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileNotice;
import fr.gouv.vitamui.pastis.common.dto.profiles.ProfileResponse;
import fr.gouv.vitamui.pastis.common.exception.TechnicalException;
import fr.gouv.vitamui.pastis.common.rest.RestApi;
import fr.gouv.vitamui.pastis.common.service.JsonFromPUA;
import fr.gouv.vitamui.pastis.common.service.PuaPastisValidator;
import fr.gouv.vitamui.pastis.server.ApiPastisServerApplication;
import fr.gouv.vitamui.pastis.server.security.WebSecurityConfig;
import fr.gouv.vitamui.pastis.server.service.PastisService;
import lombok.SneakyThrows;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Import;
import org.springframework.security.core.Authentication;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.util.UriComponentsBuilder;
import java.io.IOException;
import java.io.InputStream;
import java.security.NoSuchAlgorithmException;
import static org.mockito.ArgumentMatchers.any;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringRunner.class)
@WebMvcTest(controllers = PastisController.class)
@Import(value = { WebSecurityConfig.class, ServerIdentityConfiguration.class, RestExceptionHandler.class })
public class PastisControllerTest extends ControllerTest {
private static final VitamUILogger LOGGER = VitamUILoggerFactory.getInstance(PastisControllerTest.class);
@MockBean
private PastisService service;
private PastisController controller;
@Before
public void setUp() throws Exception {
controller = new PastisController(service);
}
@Test
public void testGetArchiveProfile_should_return_ok() throws IOException, TechnicalException {
UriComponentsBuilder uriBuilder = getUriBuilder("/archiveprofile");
Mockito.when(service.getArchiveProfile(any(ElementProperties.class))).thenReturn("");
InputStream jsonInputStream = getClass().getClassLoader().getResourceAsStream("rng/ProfileJson.json");
ObjectMapper objectMapper = new ObjectMapper();
ElementProperties dto = objectMapper.readValue(jsonInputStream, ElementProperties.class);
super.performPost(uriBuilder, asJsonString(dto), status().isOk());
}
@Test
public void testCreate() throws TechnicalException, NoSuchAlgorithmException {
Mockito.when(service.createProfile(any(String.class), any(Boolean.class))).thenReturn(new ProfileResponse());
super.performGet("/profile", ImmutableMap.of("type", "PUA"), status().isOk());
}
@Override
protected String getRessourcePrefix() {
return RestApi.PASTIS;
}
@Override
protected String[] getServices() {
return new String[] {
ServicesData.ROLE_GET_ARCHIVE_PROFILES,
ServicesData.ROLE_GET_ARCHIVE_PROFILES_UNIT,
ServicesData.ROLE_UPDATE_ARCHIVE_PROFILES,
ServicesData.ROLE_UPDATE_ARCHIVE_PROFILES_UNIT,
ServicesData.ROLE_CREATE_ARCHIVE_PROFILES,
ServicesData.ROLE_CREATE_ARCHIVE_PROFILES_UNIT,
ServicesData.ROLE_GET_PROFILES,
ServicesData.ROLE_UPDATE_PROFILES,
ServicesData.ROLE_CREATE_PROFILES,
ServicesData.ROLE_GET_PASTIS,
ServicesData.ROLE_DELETE_PASTIS,
};
}
}
...@@ -3,6 +3,7 @@ package fr.gouv.vitamui.commons.test.rest; ...@@ -3,6 +3,7 @@ package fr.gouv.vitamui.commons.test.rest;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
...@@ -34,7 +35,7 @@ public abstract class AbstractMockMvcCrudControllerTest<T extends IdDto> extends ...@@ -34,7 +35,7 @@ public abstract class AbstractMockMvcCrudControllerTest<T extends IdDto> extends
* @return ResultActions * @return ResultActions
*/ */
public ResultActions testCreateEntity(final ResultMatcher matcher) { public ResultActions testCreateEntity(final ResultMatcher matcher) {
return testCreateEntity(getHeaders()); return testCreateEntity(matcher, getHeaders());
} }
......
...@@ -66,7 +66,7 @@ public abstract class AbstractRestControllerMockMvcTest extends AbstractServerId ...@@ -66,7 +66,7 @@ public abstract class AbstractRestControllerMockMvcTest extends AbstractServerId
* @param Object * @param Object
* @return * @return
*/ */
protected static String asJsonString(final Object Object) { public static String asJsonString(final Object Object) {
try { try {
final ObjectMapper mapper = new ObjectMapper(); final ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JavaTimeModule()); mapper.registerModule(new JavaTimeModule());
......
{ {
"name": "pastis-standalone", "name": "vitamui-ui",
"version": "5.4.0-SNAPSHOT",
"license": "MIT",
"pki": { "pki": {
"path": "../../dev-deployment/environments/certs/server/hosts/localhost", "path": "../../dev-deployment/environments/certs/server/hosts/localhost",
"asset": "reverse" "asset": "reverse"
}, },