Commit 7068ce78 authored by Kevin Robert's avatar Kevin Robert
Browse files

Correction des tests et correction du login sans droits.

parent 2ddf71be
......@@ -69,7 +69,7 @@ public class FilArianeController {
} else if (PermissionService.currentUserHasAuthority(AuthoritiesConstants.AUTHORITY_VIEW_FORM)) {
return Path.ACCUEIL_FORMS;
}
return Path.PAGE_LOGIN;
return Path.FORBIDDEN;
}
/**
......
......@@ -13,4 +13,5 @@ public class Path {
// TODO : Remplacer ça pour une page d'erreur de login du type 'Vous avez bien un compte mais vous n'avez pas de droits associés, veuillez contacter votre administrateur.'
public static final String PAGE_LOGIN = "/login";
public static final String FORBIDDEN = "/forbidden";
}
......@@ -28,8 +28,8 @@ import org.springframework.web.bind.annotation.RestController;
import com.unantes.orientactive.repository.FormRepository;
import com.unantes.orientactive.service.FormService;
import com.unantes.orientactive.service.dto.FormDTO;
import com.unantes.orientactive.service.exception.FormNameAlreadyUsedException;
import com.unantes.orientactive.service.exception.FormReferenceAlreadyUsedException;
import com.unantes.orientactive.web.rest.errors.FormNameAlreadyUsedException;
import com.unantes.orientactive.web.rest.errors.FormReferenceAlreadyUsedException;
import com.unantes.orientactive.web.rest.errors.BadRequestAlertException;
import tech.jhipster.web.util.HeaderUtil;
......
......@@ -11,8 +11,8 @@ import com.unantes.orientactive.service.VariableService;
import com.unantes.orientactive.service.dto.NextScreenExpressionDTO;
import com.unantes.orientactive.service.dto.ScreenDTO;
import com.unantes.orientactive.service.dto.ScreenPanelDTO;
import com.unantes.orientactive.service.exception.ScreenNameAlreadyUsedException;
import com.unantes.orientactive.service.exception.ScreenReferenceAlreadyUsedException;
import com.unantes.orientactive.web.rest.errors.ScreenNameAlreadyUsedException;
import com.unantes.orientactive.web.rest.errors.ScreenReferenceAlreadyUsedException;
import com.unantes.orientactive.web.rest.errors.BadRequestAlertException;
import com.unantes.orientactive.web.rest.errors.ItemNotFoundException;
import com.unantes.orientactive.web.rest.errors.ScreenNotFoundException;
......
......@@ -36,10 +36,6 @@ import com.unantes.orientactive.filariane.FilArianeException;
import com.unantes.orientactive.navigation.exception.NavigationException;
import com.unantes.orientactive.security.permissions.web.PermissionException;
import com.unantes.orientactive.service.exception.EntityNotFoundException;
import com.unantes.orientactive.service.exception.FormNameAlreadyUsedException;
import com.unantes.orientactive.service.exception.FormReferenceAlreadyUsedException;
import com.unantes.orientactive.service.exception.ScreenNameAlreadyUsedException;
import com.unantes.orientactive.service.exception.ScreenReferenceAlreadyUsedException;
import com.unantes.orientactive.service.exception.UsernameAlreadyUsedException;
import tech.jhipster.config.JHipsterConstants;
......
package com.unantes.orientactive.service.exception;
package com.unantes.orientactive.web.rest.errors;
import com.unantes.orientactive.web.rest.errors.BadRequestAlertException;
import com.unantes.orientactive.web.rest.errors.ErrorConstants;
......
package com.unantes.orientactive.service.exception;
package com.unantes.orientactive.web.rest.errors;
import com.unantes.orientactive.web.rest.errors.BadRequestAlertException;
import com.unantes.orientactive.web.rest.errors.ErrorConstants;
......
package com.unantes.orientactive.service.exception;
package com.unantes.orientactive.web.rest.errors;
import com.unantes.orientactive.web.rest.errors.BadRequestAlertException;
import com.unantes.orientactive.web.rest.errors.ErrorConstants;
......
package com.unantes.orientactive.service.exception;
package com.unantes.orientactive.web.rest.errors;
import com.unantes.orientactive.web.rest.errors.BadRequestAlertException;
import com.unantes.orientactive.web.rest.errors.ErrorConstants;
......
......@@ -20,13 +20,13 @@ public class ExpressionParsing {
@Test
public void displayCondition() throws JsonProcessingException {
String s1 =
"(answers[S1_Q1_V1] or answers[S1_Q1_V2]) and variables[score_spe_scient_bacG] > 2 and scores[spes_bac_g_scient6] >= 2 and hasAnswer('spes_bac_g_scient4')";
"(answers[S1_Q1__V1] or answers[S1_Q1__V2]) and variables[score_spe_scient__bacG] > 2 and scores[spes_bac_g__scient6] >= 2 and hasAnswer('spes_bac_g__scient4')";
parseDisplayCondition(s1);
System.out.println("---------------------------------------------");
String s2 = "answers[S1_Q1_V1] and (answers[S1_Q2_V1] or answers[S1_Q1_V2]) and answers[S2_Q1_V1]";
String s2 = "answers[S1_Q1__V1] and (answers[S1_Q2__V1] or answers[S1_Q1__V2]) and answers[S2_Q1__V1]";
parseDisplayCondition(s2);
System.out.println("---------------------------------------------");
String s3 = "answers[S1_Q1_V1]";
String s3 = "answers[S1_Q1__V1]";
parseDisplayCondition(s3);
}
......@@ -42,11 +42,11 @@ public class ExpressionParsing {
"scores[spes_bac_g_scient4] == 0 and scores[spes_bac_g_scient6] == 0 and (scores[spes_bac_g_scient1] > 0 or scores[spes_bac_g_scient2] > 0 or scores[spes_bac_g_scient3] > 0 or scores[spes_bac_g_scient5] > 0 or scores[spes_bac_g_scient7] > 0)";
String s5 =
"answers[profil_scol_type_bac_T] and not (answers[spes_bac_t_serie_bac_STL] or answers[spes_bac_t_serie_bac_ST2S] or answers[spes_bac_t_serie_bac_STD2A])";
parseDisplayCondition(s1);
//parseDisplayCondition(s1);
parseDisplayCondition(s2);
parseDisplayCondition(s3);
parseDisplayCondition(s4);
parseDisplayCondition(s5);
//parseDisplayCondition(s5);
}
@Test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment