backend-api http://jira.mfd.msk:8088/browse/CLS-64 UserSettingsController fix unit test (see ea561b9a85)
This commit is contained in:
parent
26e8dd200a
commit
e5e7f774e5
2 changed files with 2 additions and 2 deletions
|
|
@ -52,7 +52,7 @@ public class UserSettingsController extends AbstractQueueController {
|
|||
public CommonGetAllResponse getAllForCurrentUser() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
String username = KeycloakUtils.getUserNameFromAuthentication(authentication);
|
||||
User user = userImdg.getSingleObjectByFieldValues(Map.of("identifier", username));
|
||||
User user = username == null ? null : userImdg.getSingleObjectByFieldValues(Map.of("identifier", username));
|
||||
if (user == null) {
|
||||
throw new IllegalStateException("cannot obtain userId from logged in user " + username);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class UserSettingsControllerTest extends AbstractControllerTest {
|
|||
//ARRANGE
|
||||
UserSettings userSettings = new UserSettings();
|
||||
userSettings.setId(currentId.get());
|
||||
userSettings.setUserId(currentId.get());
|
||||
userSettings.setUserId(currentId.get()); // отдаются по userId CLS-64, todo в тесте null
|
||||
userSettings.setJson("json");
|
||||
userSettings.setVersion("version");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue