@Test
public void testSynchronizeDeleteApiKey_OneCharacter() {
Key<User> userKey = new Key<User>(User.class, 1);
Key<ApiKey> apiKeyKey = new Key<ApiKey>(ApiKey.class, 1);
ArrayList<Character> characters = new ArrayList<Character>();
Character character = new Character();
character.setApiKey(apiKeyKey);
character.setCharacterID(1L);
character.setCorporationID(2L);
character.setCorporationName("corporationName");
character.setCorporationTicker("corporationTicker");
ArrayList<String> corporationTitles = new ArrayList<String>();
corporationTitles.add("corporationTitle");
character.setCorporationTitles(corporationTitles);
character.setAllianceID(3L);
character.setAllianceName("allianceNAme");
character.setCreatedDate(new Date());
characters.add(character);
when(characterDao.getAll(apiKeyKey, userKey)).thenReturn(characters);
eveSynchronizationService.synchronizeDeleteApiKey(apiKeyKey, userKey);
verify(characterDao, times(1)).putWithoutChecks(characterCaptor.capture());
Character capturedCharacter = characterCaptor.getValue();
assertNull(capturedCharacter.getApiKey());
assertNull(capturedCharacter.getCorporationID());
assertNull(capturedCharacter.getCorporationName());
assertNull(capturedCharacter.getCorporationTicker());
assertNull(capturedCharacter.getCorporationTitles());
assertNull(capturedCharacter.getAllianceID());
assertNull(capturedCharacter.getAllianceName());
assertNotNull(capturedCharacter.getCreatedDate());
assertNotNull(capturedCharacter.getUpdatedDate());
verify(characterSynchronizationService).synchronizeDetachCharacters(characterListCaptor.capture(), eq(userKey));
List<Character> capturedCharacterList = characterListCaptor.getValue();
assertEquals(1, capturedCharacterList.size());
assertEquals(character, capturedCharacterList.get(0));
}