-
Notifications
You must be signed in to change notification settings - Fork 6
Feature 2433/enhance settings controller #2435
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
Conversation
…DTO to make logic on UI simpler.
…DTO to make logic on UI simpler.
…into feature-2433/enhance-settings-controller
|
closes: #2433 |
jackkeller
left a comment
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.
LGTM, though I know nothing of Java :D
| assertEquals(HttpStatus.UNAUTHORIZED,responseException.getStatus()); | ||
|
|
||
| } | ||
|
|
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.
For coverage, is it worth testing the UPDATE with an unknown (but valid) setting name, as in
| @Test | |
| void testPUTValidDTOButUnknownName() { | |
| final MemberProfile lucy = getMemberProfileRepository().save(mkMemberProfile("Lucy")); | |
| SettingsDTO updatedSetting = new SettingsDTO(); | |
| updatedSetting.setName(SettingOption.LOGO_URL.toString()); | |
| updatedSetting.setValue("Missing"); | |
| final HttpRequest<SettingsDTO> request = HttpRequest. | |
| PUT("/", updatedSetting).basicAuth(lucy.getWorkEmail(),ADMIN_ROLE); | |
| HttpClientResponseException responseException = assertThrows(HttpClientResponseException.class, | |
| () -> client.toBlocking().exchange(request, Map.class)); | |
| assertEquals(HttpStatus.NOT_FOUND, responseException.getStatus()); | |
| assertEquals("Setting with name %s not found.".formatted(SettingOption.LOGO_URL.toString()), responseException.getMessage()); | |
| } |
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.
For coverage, is it worth testing the UPDATE with an unknown (but valid) setting name, as in
Good catch. Updated.
No description provided.