### Question:
UserPushDeviceProfileManager { public void saveDeviceProfile(@Nonnull String user, @Nonnull String realm, @Nonnull PushDeviceSettings deviceSettings) throws AuthLoginException { Reject.ifNull(user, realm, deviceSettings); try { devicesDao.saveDeviceProfiles(user, realm, jsonUtils.toJsonValues(Collections.singletonList(deviceSettings))); } catch (IOException e) { debug.error("Pusher.createDeviceProfile(): Unable to save device profile for user {} in realm {}", user, realm, e); throw new AuthLoginException(e); } } @Inject  UserPushDeviceProfileManager(final @Nonnull PushDevicesDao devicesDao,
                                        final @Nonnull @Named("amAuthPush") Debug debug,
                                        final @Nonnull SecureRandom secureRandom,
                                        final @Nonnull DeviceJsonUtils<PushDeviceSettings> jsonUtils); PushDeviceSettings createDeviceProfile(); String createRandomBytes(int byteNum); void saveDeviceProfile(@Nonnull String user, @Nonnull String realm,
                                  @Nonnull PushDeviceSettings deviceSettings); List<PushDeviceSettings> getDeviceProfiles(@Nonnull String user, @Nonnull String realm);  }### Answer:
@Test public void shouldSaveProfile() throws IOException, AuthLoginException { PushDeviceSettings deviceSettings = new PushDeviceSettings(); deviceSettings.setSharedSecret("sekret"); deviceSettings.setDeviceName("test device"); JsonValue expectedJson = new DeviceJsonUtils<>(PushDeviceSettings.class).toJsonValue(deviceSettings); userPushDeviceProfileManager.saveDeviceProfile(USER, REALM, deviceSettings); ArgumentCaptor<List> savedProfileList = ArgumentCaptor.forClass(List.class); verify(mockDevicesDao).saveDeviceProfiles(eq(USER), eq(REALM), savedProfileList.capture()); assertThat(savedProfileList.getValue()).hasSize(1); assertThat(savedProfileList.getValue().get(0).toString()).isEqualTo(expectedJson.toString()); }