-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAN-140 STOP screen - service is down (unscheduled) #196
SAN-140 STOP screen - service is down (unscheduled) #196
Conversation
…duled # Conflicts: # src/main/java/uk/gov/companieshouse/web/pps/controller/pps/ConfirmationController.java # src/test/java/uk/gov/companieshouse/web/pps/controller/pps/ConfirmationControllerTest.java
…duled # Conflicts: # src/main/java/uk/gov/companieshouse/web/pps/controller/pps/BankTransferSanctionsDetailsController.java # src/test/java/uk/gov/companieshouse/web/pps/controller/pps/BankTransferSanctionsDetailsControllerTest.java
CI: No security warnings found |
public String getUnscheduledServiceDown(Model model) { | ||
|
||
String loginEmail = penaltyUtils.getLoginEmail(sessionService); | ||
if (loginEmail != null && !loginEmail.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use apache.commons here and just do:
StringUtils.isEmpty(loginEmail)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part should be changed/removed now after SAN-166 changes
|
||
@GetMapping | ||
public String getUnscheduledServiceDown(Model model) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated from review
private static final String COMPANY_NUMBER = "12345678"; | ||
private static final String PENALTY_REF = "EXAMPLE12345"; | ||
private static final String PAYABLE_REF = "PR_123456"; | ||
|
||
private static final String VIEW_CONFIRMATION_PATH = "/late-filing-penalty/company/" + COMPANY_NUMBER + "/penalty/" + PENALTY_REF + "/payable/" + PAYABLE_REF + "/confirmation"; | ||
|
||
private static final String RESUME_URL_PATH = "redirect:/late-filing-penalty/company/" + COMPANY_NUMBER + "/penalty/" + PENALTY_REF + "/view-penalties"; | ||
private static final String UNSCHEDULED_SERVICE_DOWN_PATH = "/late-filing-penalty/unscheduled-service-down"; | ||
|
||
private static final String CONFIRMATION_VIEW = "pps/confirmationPage"; | ||
private static final String ERROR_VIEW = "error"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused variable 'ERROR_VIEW'
Also, if you don't mind, could you remove it from 'BankTransferSanctionsDetailsControllerTest.java' too? I know you didn't touch that file but it would be great to clean that up too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated from review
@@ -64,6 +69,7 @@ class SignOutControllerTest { | |||
private static final String PREVIOUS_PATH = "/late-filing-penalty/enter-details"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused variables line 62:
MOCK_CONTROLLER_PATH = UrlBasedViewResolver.REDIRECT_URL_PREFIX + "mockControllerPath";
HOME = "/late-filing-penalty/";
ERROR_VIEW = "error";
Can you also check the formatting of this file, there's a load of extra line where they are not needed throughout the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from the file and some of the empty lines also
@@ -59,6 +64,7 @@ void setup() { | |||
private static final String START_PATH = "/late-filing-penalty"; | |||
private static final String START_PATH_PARAM = "/late-filing-penalty?start=0"; | |||
private static final String MOCK_CONTROLLER_PATH = UrlBasedViewResolver.REDIRECT_URL_PREFIX + "mockControllerPath"; | |||
private static final String UNSCHEDULED_SERVICE_DOWN_PATH = "/late-filing-penalty/unscheduled-service-down"; | |||
|
|||
private static final String PPS_START_VIEW = "pps/home"; | |||
private static final String ERROR_VIEW = "error"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated from review
@InjectMocks | ||
private ViewPenaltiesController controller; | ||
|
||
private static final String COMPANY_NUMBER = "12345678"; | ||
private static final String PENALTY_NUMBER = "44444444"; | ||
|
||
private static final String VIEW_PENALTIES_PATH = "/late-filing-penalty/company/" + COMPANY_NUMBER + "/penalty/" + PENALTY_NUMBER + "/view-penalties"; | ||
private static final String UNSCHEDULED_SERVICE_DOWN_PATH = "/late-filing-penalty/unscheduled-service-down"; | ||
|
||
private static final String ENTER_PPS_DETAILS_VIEW = "pps/viewPenalties"; | ||
private static final String ERROR_VIEW = "error"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated from review
@@ -92,6 +97,8 @@ class EnterDetailsControllerTest { | |||
private static final String ALREADY_PAID_PATH = | |||
"redirect:/late-filing-penalty/company/" + VALID_COMPANY_NUMBER + "/penalty/" + VALID_PENALTY_REF + "/penalty-paid"; | |||
|
|||
private static final String UNSCHEDULED_SERVICE_DOWN_PATH = "/late-filing-penalty/unscheduled-service-down"; | |||
|
|||
private static final String ERROR_PAGE = "error"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated from review
…duled # Conflicts: # src/main/java/uk/gov/companieshouse/web/pps/controller/pps/EnterDetailsController.java
CI: No security warnings found |
CI: No security warnings found |
Change for this ticket, adding a unscheduled down page |
CI: No security warnings found |
…duled # Conflicts: # src/test/java/uk/gov/companieshouse/web/pps/controller/pps/EnterDetailsControllerTest.java # src/test/java/uk/gov/companieshouse/web/pps/controller/pps/PenaltyPaidControllerTest.java
CI: No security warnings found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see this expression in multiple locations: "REDIRECT_URL_PREFIX + penaltyConfigurationProperties.getUnscheduledServiceDownPath();" A method call, maybe?
I will go ahead and approve as it is just a nice to have.
CI: No security warnings found |
Moved "REDIRECT_URL_PREFIX + penaltyConfigurationProperties.getUnscheduledServiceDownPath();" into Util from comment |
CI: No security warnings found |
Set up page for STOP screen - service is down (unscheduled)