Package lv.odylab.evemanage.domain.eve

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


    @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);
View Full Code Here


    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);
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);
View Full Code Here

        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>();
View Full Code Here

        assertEquals(Base64.encodeBytes("encryptedApiKey".getBytes()), apiKey.getEncodedApiKeyString());
        assertEquals("apiKeyHash", apiKey.getApiKeyHash());
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = apiKey.getCharacterInfos();
        assertEquals(2, apiKeyCharacterInfos.size());
        ApiKeyCharacterInfo apiKeyCharacterInfo1 = apiKeyCharacterInfos.get(0);
        assertEquals(Long.valueOf(2), apiKeyCharacterInfo1.getCharacterID());
        assertEquals("character1", apiKeyCharacterInfo1.getName());
        assertEquals(Long.valueOf(3), apiKeyCharacterInfo1.getCorporationID());
        assertEquals("corporation1", apiKeyCharacterInfo1.getCorporationName());
        ApiKeyCharacterInfo apiKeyCharacterInfo2 = apiKeyCharacterInfos.get(1);
        assertEquals(Long.valueOf(4), apiKeyCharacterInfo2.getCharacterID());
        assertEquals("character2", apiKeyCharacterInfo2.getName());
        assertEquals(Long.valueOf(5), apiKeyCharacterInfo2.getCorporationID());
        assertEquals("corporation2", apiKeyCharacterInfo2.getCorporationName());
        assertNotNull(apiKey.getLastCheckDate());
        assertTrue(apiKey.isValid());
        assertEquals("FULL", apiKey.getKeyType());
        assertNotNull(apiKey.getUpdatedDate());
        assertNull(apiKey.getCreatedDate());
View Full Code Here

        List<AccountCharacterDto> apiCharacters = eveApiGateway.getApiKeyCharacters(apiKeyString, apiKeyUserID);
        List<ApiKeyCharacterInfo> apiKeyCharacterInfos = new ArrayList<ApiKeyCharacterInfo>();
        logger.debug("Api key has {} characters", apiCharacters.size());
        for (AccountCharacterDto apiCharacter : apiCharacters) {
            logger.debug("Api key has character: {} ({})", apiCharacter.getName(), apiCharacter.getCharacterID());
            ApiKeyCharacterInfo apiKeyCharacterInfo = new ApiKeyCharacterInfo();
            apiKeyCharacterInfo.setCharacterID(apiCharacter.getCharacterID());
            apiKeyCharacterInfo.setName(apiCharacter.getName());
            apiKeyCharacterInfo.setCorporationID(apiCharacter.getCorporationID());
            apiKeyCharacterInfo.setCorporationName(apiCharacter.getCorporationName());
            apiKeyCharacterInfos.add(apiKeyCharacterInfo);
        }
        apiKey.setCharacterInfos(apiKeyCharacterInfos);
        apiKey.setLastCheckDate(new Date());
        apiKey.setValid(Boolean.TRUE);
View Full Code Here

TOP

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

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.