Skip to content

Conversation

@mjperry91
Copy link
Collaborator

No description provided.

…into feature-2433/enhance-settings-controller
@mjperry91
Copy link
Collaborator Author

closes: #2433

Copy link
Collaborator

@jackkeller jackkeller left a 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());

}

Copy link
Contributor

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

Suggested change
@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());
}

Copy link
Collaborator Author

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.

@mjperry91 mjperry91 merged commit 243b35f into develop May 24, 2024
@mjperry91 mjperry91 deleted the feature-2433/enhance-settings-controller branch May 24, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants