Package lv.odylab.evemanage.domain.eve

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


        when(apiKeyDao.getWithCharacterID(1L, userKey)).thenReturn(apiKeyKey);
        eveManagementService.createCharacter(1L, userKey);

        verify(eveApiDataService, times(1)).populateCharacterData(characterCaptor.capture());
        Character character = characterCaptor.getValue();
        assertEquals(apiKeyKey, character.getApiKey());
        assertEquals(userKey, character.getUser());
        assertEquals(Long.valueOf(1), character.getCharacterID());
        assertNotNull(character.getCreatedDate());
        verify(characterDao, times(1)).put(character, userKey);
        verify(synchronizationService, times(1)).synchronizeCreateCharacter(character, userKey);
    }
View Full Code Here


    }

    @Test
    public void testDeleteCharacter() {
        Key<User> userKey = new Key<User>(User.class, 1);
        Character character = new Character();
        character.setCharacterID(2L);
        when(characterDao.get(new Key<Character>(Character.class, 1))).thenReturn(character);
        eveManagementService.deleteCharacter(1L, userKey);
        verify(characterDao, times(1)).delete(characterKeyCaptor.capture(), eq(userKey));
        assertEquals(1, characterKeyCaptor.getValue().getId());
        verify(synchronizationService).synchronizeDeleteCharacter(2L, userKey);
View Full Code Here

    @Test
    public void testSynchronizeMainCharacter_OneCharacter_NoMainCharacter() {
        Key<User> userKey = new Key<User>(User.class, 1);
        User user = new User();
        List<Character> characters = new ArrayList<Character>();
        Character character = new Character();
        character.setId(1L);
        character.setCharacterID(1L);
        characters.add(character);

        when(userDao.get(userKey)).thenReturn(user);
        when(characterDao.getAll(userKey)).thenReturn(characters);
        when(characterDao.get(new Key<Character>(Character.class, 1))).thenReturn(character);
View Full Code Here

    @Test
    public void testSynchronizeMainCharacter_TwoCharacters_NoMainCharacter() {
        Key<User> userKey = new Key<User>(User.class, 1);
        User user = new User();
        List<Character> characters = new ArrayList<Character>();
        Character character1 = new Character();
        character1.setId(1L);
        character1.setCharacterID(1L);
        Character character2 = new Character();
        character2.setId(2L);
        character2.setCharacterID(2L);
        characters.add(character1);
        characters.add(character2);

        when(userDao.get(userKey)).thenReturn(user);
        when(characterDao.getAll(userKey)).thenReturn(characters);
View Full Code Here

        CharacterInfo characterInfo = new CharacterInfo();
        characterInfo.setId(2L);
        characterInfo.setCharacterID(2L);
        user.setMainCharacterInfo(characterInfo);
        List<Character> characters = new ArrayList<Character>();
        Character character1 = new Character();
        character1.setId(1L);
        character1.setCharacterID(1L);
        Character character2 = new Character();
        character2.setId(2L);
        character2.setCharacterID(2L);
        characters.add(character1);
        characters.add(character2);

        when(userDao.get(userKey)).thenReturn(user);
        when(characterDao.getAll(userKey)).thenReturn(characters);
View Full Code Here

        CharacterInfo characterInfo = new CharacterInfo();
        characterInfo.setId(3L);
        characterInfo.setCharacterID(3L);
        user.setMainCharacterInfo(characterInfo);
        List<Character> characters = new ArrayList<Character>();
        Character character1 = new Character();
        character1.setId(1L);
        character1.setCharacterID(1L);
        Character character2 = new Character();
        character2.setId(2L);
        character2.setCharacterID(2L);
        characters.add(character1);
        characters.add(character2);

        when(userDao.get(userKey)).thenReturn(user);
        when(characterDao.getAll(userKey)).thenReturn(characters);
View Full Code Here

    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);
        characterSheetDto.setName("characterName");
        characterSheetDto.setCorporationID(4L);
        characterSheetDto.setCorporationName("corporationName");
        List<String> corporationTitles = new ArrayList<String>();
        corporationTitles.add("corporationTitle1");
        corporationTitles.add("corporationTitle2");
        characterSheetDto.setCorporationTitles(corporationTitles);
        CorporationSheetDto corporationSheetDto = new CorporationSheetDto();
        corporationSheetDto.setTicker("ticker");
        corporationSheetDto.setAllianceID(5L);
        corporationSheetDto.setAllianceName("allianceName");

        when(securityManager.decrypt("encryptedApiKey".getBytes())).thenReturn("apiKeyString".getBytes());
        when(apiKeyDao.get(apiKeyKey)).thenReturn(apiKey);
        when(eveApiGateway.getCharacterSheet("apiKeyString", 2L, 1L)).thenReturn(characterSheetDto);
        when(eveApiGateway.getCorporationSheet(4L)).thenReturn(corporationSheetDto);
        eveApiDataService.populateCharacterData(character);

        assertEquals("characterName", character.getName());
        assertEquals(Long.valueOf(4), character.getCorporationID());
        assertEquals("corporationName", character.getCorporationName());
        assertEquals(2, character.getCorporationTitles().size());
        assertEquals("corporationTitle1", character.getCorporationTitles().get(0));
        assertEquals("corporationTitle2", character.getCorporationTitles().get(1));
        assertEquals("corporationTitle2", character.getCorporationTitles().get(1));
        assertEquals("ticker", character.getCorporationTicker());
        assertEquals(Long.valueOf(5), character.getAllianceID());
        assertEquals("allianceName", character.getAllianceName());
        assertNotNull(character.getUpdatedDate());
        assertNull(character.getCreatedDate());
    }
View Full Code Here

    }

    @Test
    public void testLaunchForDetach() {
        when(googleAppEngineServices.getQueue("default")).thenReturn(queue);
        Character character = new Character();
        character.setCharacterID(1L);
        character.setName("characterName");
        List<Blueprint> blueprints = new ArrayList<Blueprint>();
        Blueprint blueprint1 = new Blueprint();
        blueprint1.setId(2L);
        Blueprint blueprint2 = new Blueprint();
        blueprint2.setId(3L);
View Full Code Here

    }

    @Test
    public void testLaunchForUpdate() {
        when(googleAppEngineServices.getQueue("default")).thenReturn(queue);
        Character character = new Character();
        character.setCharacterID(1L);
        character.setName("characterName");
        character.setCorporationID(2L);
        character.setCorporationName("corporationName");
        character.setCorporationTicker("corporationTicker");
        character.setAllianceID(3L);
        character.setAllianceName("allianceName");
        List<Blueprint> blueprints = new ArrayList<Blueprint>();
        Blueprint blueprint1 = new Blueprint();
        blueprint1.setId(4L);
        Blueprint blueprint2 = new Blueprint();
        blueprint2.setId(5L);
View Full Code Here

    }

    @Test
    public void testLaunchForUpdate_NoCorporation() {
        when(googleAppEngineServices.getQueue("default")).thenReturn(queue);
        Character character = new Character();
        character.setCharacterID(1L);
        character.setName("characterName");
        List<Blueprint> blueprints = new ArrayList<Blueprint>();
        Blueprint blueprint1 = new Blueprint();
        blueprint1.setId(4L);
        Blueprint blueprint2 = new Blueprint();
        blueprint2.setId(5L);
View Full Code Here

TOP

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

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.