### Question:
OathMaker { void saveDeviceProfile(@Nonnull String user, @Nonnull String realm, @Nonnull OathDeviceSettings deviceSettings) throws AuthLoginException { Reject.ifNull(user, realm, deviceSettings); try { devicesDao.saveDeviceProfiles(user, realm, jsonUtils.toJsonValues(Collections.singletonList(deviceSettings))); } catch (IOException e) { debug.error("OathMaker.createDeviceProfile(): Unable to save device profile for user {} in realm {}", user, realm, e); throw new AuthLoginException(e); } } @Inject  OathMaker(final @Nonnull OathDevicesDao devicesDao,
              final @Nonnull @Named("amAuthOATH") Debug debug,
              final @Nonnull SecureRandom secureRandom,
              final @Nonnull DeviceJsonUtils<OathDeviceSettings> jsonUtils);   }### Answer:
@Test @SuppressWarnings({"unchecked", "rawtypes"}) public void shouldSaveGeneratedDevice() throws Exception { OathDeviceSettings deviceSettings = new OathDeviceSettings(); deviceSettings.setCounter(42); deviceSettings.setSharedSecret("sekret"); deviceSettings.setChecksumDigit(true); deviceSettings.setLastLogin(99, TimeUnit.MILLISECONDS); deviceSettings.setDeviceName("test device"); deviceSettings.setTruncationOffset(32); JsonValue expectedJson = new DeviceJsonUtils<>(OathDeviceSettings.class).toJsonValue(deviceSettings); testFactory.saveDeviceProfile(USER, REALM, deviceSettings); ArgumentCaptor<List> savedProfileList = ArgumentCaptor.forClass(List.class); verify(mockDao).saveDeviceProfiles(eq(USER), eq(REALM), savedProfileList.capture()); assertThat(savedProfileList.getValue()).hasSize(1); assertThat(savedProfileList.getValue().get(0).toString()).isEqualTo(expectedJson.toString()); }