Package lv.odylab.evemanage.domain.eve

Examples of lv.odylab.evemanage.domain.eve.ApiKey


    }

    @Test
    public void testSynchronizeCreateApiKey_NoKeyCharacters_NoDetachedCharacters() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        when(characterDao.getAllWithoutApiKey(userKey)).thenReturn(new ArrayList<Character>());
        eveSynchronizationService.synchronizeCreateApiKey(apiKey, userKey);
        verify(characterSynchronizationService).synchronizeUpdateCharacters(characterListCaptor.capture(), eq(userKey));
        assertEquals(0, characterListCaptor.getValue().size());
    }
View Full Code Here


    }

    @Test
    public void testSynchronizeCreateApiKey_NoKeyCharacter_TwoDetachedCharacters() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        ArrayList<Character> characters = new ArrayList<Character>();
        Character character1 = new Character();
        character1.setCharacterID(1L);
        Character character2 = new Character();
        character2.setCharacterID(2L);
View Full Code Here

    }

    @Test
    public void testSynchronizeCreateApiKey_OneKeyCharacter_NoDetachedCharacters() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = new ArrayList<ApiKeyCharacterInfo>();
        ApiKeyCharacterInfo apiKeyCharacterInfo = new ApiKeyCharacterInfo();
        apiKeyCharacterInfo.setCharacterID(1L);
        apiKeyCharacterInfos.add(apiKeyCharacterInfo);
        apiKey.setCharacterInfos(apiKeyCharacterInfos);

        when(characterDao.getAllWithoutApiKey(userKey)).thenReturn(new ArrayList<Character>());
        eveSynchronizationService.synchronizeCreateApiKey(apiKey, userKey);

        verify(characterDao, never()).put(any(Character.class), eq(userKey));
View Full Code Here

    }

    @Test
    public void testSynchronizeCreateApiKey_OneKeyCharacter_OneMatchingDetachedCharacter() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        apiKey.setId(1L);
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = new ArrayList<ApiKeyCharacterInfo>();
        ApiKeyCharacterInfo apiKeyCharacterInfo = new ApiKeyCharacterInfo();
        apiKeyCharacterInfo.setCharacterID(2L);
        apiKeyCharacterInfos.add(apiKeyCharacterInfo);
        apiKey.setCharacterInfos(apiKeyCharacterInfos);
        ArrayList<Character> characters = new ArrayList<Character>();
        Character character = new Character();
        character.setCharacterID(2L);
        characters.add(character);
View Full Code Here

    }

    @Test
    public void testSynchronizeCreateApiKey_OneKeyCharacter_OneNotMatchingDetachedCharacter() throws EveApiException {
        Key<User> userKey = new Key<User>(User.class, 1);
        ApiKey apiKey = new ApiKey();
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = new ArrayList<ApiKeyCharacterInfo>();
        ApiKeyCharacterInfo apiKeyCharacterInfo = new ApiKeyCharacterInfo();
        apiKeyCharacterInfo.setCharacterID(2L);
        apiKeyCharacterInfos.add(apiKeyCharacterInfo);
        apiKey.setCharacterInfos(apiKeyCharacterInfos);
        ArrayList<Character> characters = new ArrayList<Character>();
        Character character = new Character();
        character.setCharacterID(3L);
        characters.add(character);
View Full Code Here

    @Test
    public void testSynchronizeDeleteApiKey_OneCharacter_OtherKey() {
        Key<User> userKey = new Key<User>(User.class, 1);
        Key<ApiKey> apiKeyKey = new Key<ApiKey>(ApiKey.class, 1);
        List<ApiKey> otherApiKeys = new ArrayList<ApiKey>();
        ApiKey otherApiKey = new ApiKey();
        otherApiKey.setId(2L);
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = new ArrayList<ApiKeyCharacterInfo>();
        ApiKeyCharacterInfo apiKeyCharacterInfo = new ApiKeyCharacterInfo();
        apiKeyCharacterInfo.setCharacterID(1L);
        apiKeyCharacterInfos.add(apiKeyCharacterInfo);
        otherApiKey.setCharacterInfos(apiKeyCharacterInfos);
        otherApiKeys.add(otherApiKey);

        ArrayList<Character> characters = new ArrayList<Character>();
        Character character = new Character();
        character.setApiKey(apiKeyKey);
View Full Code Here

        for (int i = 0; i < 500; i++) {
            User user = new User();
            userDao.put(user);
            Key<User> userKey = new Key<User>(User.class, user.getId());
            for (int j = 0; j < 10; j++) {
                ApiKey apiKey = new ApiKey();
                apiKey.setUser(userKey);
                apiKeyDao.putWithoutChecks(apiKey);
            }
        }

        startApiKeyUpdateCronServlet.doGet(null, null);
View Full Code Here

    @Test
    public void testUpdateApiKeysForUser_OneKey_TwoCharacters() throws EveApiException, ApiKeyShouldBeRemovedException {
        Key<User> userKey = new Key<User>(User.class, 1);
        List<ApiKey> apiKeys = new ArrayList<ApiKey>();
        ApiKey apiKey = new ApiKey();
        apiKeys.add(apiKey);
        List<Character> characters = new ArrayList<Character>();
        Character character1 = new Character();
        Character character2 = new Character();
        characters.add(character1);
View Full Code Here

    @Test
    public void testUpdateApiKeysForUser_OneKey_TwoCharacters_InvalidApiKey() throws EveApiException, ApiKeyShouldBeRemovedException {
        Key<User> userKey = new Key<User>(User.class, 1);
        List<ApiKey> apiKeys = new ArrayList<ApiKey>();
        ApiKey apiKey = new ApiKey();
        apiKeys.add(apiKey);
        apiKey.setCharacterInfos(new ArrayList<ApiKeyCharacterInfo>());
        apiKey.setValid(Boolean.TRUE);
        List<Character> characters = new ArrayList<Character>();
        Character character1 = new Character();
        character1.setCorporationID(1L);
        character1.setCorporationName("corporationName");
        List<String> corporationTitles = new ArrayList<String>();
View Full Code Here

    }

    @Test
    public void testPopulateCharacterData() throws EveApiException, IOException {
        Key<ApiKey> apiKeyKey = new Key<ApiKey>(ApiKey.class, 1);
        ApiKey apiKey = new ApiKey();
        apiKey.setApiKeyUserID(2L);
        apiKey.setEncodedApiKeyString(Base64.encodeBytes("encryptedApiKey".getBytes()));
        Character character = new Character();
        character.setCharacterID(1L);
        character.setApiKey(apiKeyKey);
        CharacterSheetDto characterSheetDto = new CharacterSheetDto();
        characterSheetDto.setCharacterID(1L);
View Full Code Here

TOP

Related Classes of lv.odylab.evemanage.domain.eve.ApiKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.