Package lv.odylab.evemanage.domain.eve

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


        assertNull(character.getCreatedDate());
    }

    @Test
    public void testPopulateCharacterData_NoApiKey() throws EveApiException, IOException {
        Character character = new Character();
        eveApiDataService.populateCharacterData(character);
        verify(apiKeyDao, never()).get(any(Key.class));
    }
View Full Code Here


    @Test
    public void testDoPost() throws Exception {
        PriceSet priceSet = new PriceSet();
        CharacterInfo attachedCharacterInfo = new CharacterInfo();
        attachedCharacterInfo.setId(2L);
        lv.odylab.evemanage.domain.eve.Character character = new Character();
        character.setCharacterID(3L);
        character.setName("characterName");
        character.setCorporationID(4L);
        character.setCorporationName("corporationName");
        character.setCorporationTicker("corporationTicker");
        character.setAllianceID(5L);
        character.setAllianceName("allianceName");
        priceSet.setAttachedCharacterInfo(attachedCharacterInfo);
        when(httpServletRequest.getParameter("priceSetID")).thenReturn("1");
        when(priceSetDao.get(new Key<PriceSet>(PriceSet.class, 1))).thenReturn(priceSet);
        when(characterDao.get(new Key<Character>(Character.class, 2))).thenReturn(character);
        checkPriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
View Full Code Here

    @Test
    public void testDoPost() throws Exception {
        Blueprint blueprint = new Blueprint();
        CharacterInfo attachedCharacterInfo = new CharacterInfo();
        attachedCharacterInfo.setId(2L);
        Character character = new Character();
        character.setCharacterID(3L);
        character.setName("characterName");
        character.setCorporationID(4L);
        character.setCorporationName("corporationName");
        character.setCorporationTicker("corporationTicker");
        character.setAllianceID(5L);
        character.setAllianceName("allianceName");
        blueprint.setAttachedCharacterInfo(attachedCharacterInfo);
        when(httpServletRequest.getParameter("blueprintID")).thenReturn("1");
        when(blueprintDao.get(new Key<Blueprint>(Blueprint.class, 1))).thenReturn(blueprint);
        when(characterDao.get(new Key<Character>(Character.class, 2))).thenReturn(character);
        checkBlueprintTaskServlet.doPost(httpServletRequest, httpServletResponse);
View Full Code Here

    }

    @Test
    public void testSynchronizeCreateCharacter() {
        Key<User> userKey = new Key<User>(User.class, 1);
        Character character = new Character();
        eveSynchronizationService.synchronizeCreateCharacter(character, userKey);
        verify(characterSynchronizationService).synchronizeCreateCharacter(character, userKey);
    }
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);
        characters.add(character1);
        characters.add(character2);

        when(characterDao.getAllWithoutApiKey(userKey)).thenReturn(characters);
        eveSynchronizationService.synchronizeCreateApiKey(apiKey, userKey);
View Full Code Here

        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);

        when(characterDao.getAllWithoutApiKey(userKey)).thenReturn(characters);
        eveSynchronizationService.synchronizeCreateApiKey(apiKey, userKey);
View Full Code Here

        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);

        when(characterDao.getAllWithoutApiKey(userKey)).thenReturn(characters);
        eveSynchronizationService.synchronizeCreateApiKey(apiKey, userKey);
View Full Code Here

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

    }

    @Test
    public void testLaunchForDetach() {
        when(googleAppEngineServices.getQueue("default")).thenReturn(queue);
        lv.odylab.evemanage.domain.eve.Character character = new Character();
        character.setCharacterID(1L);
        character.setName("characterName");
        List<PriceSet> priceSets = new ArrayList<PriceSet>();
        PriceSet priceSet1 = new PriceSet();
        priceSet1.setId(2L);
        PriceSet priceSet2 = new PriceSet();
        priceSet2.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<PriceSet> priceSets = new ArrayList<PriceSet>();
        PriceSet priceSet1 = new PriceSet();
        priceSet1.setId(4L);
        PriceSet priceSet2 = new PriceSet();
        priceSet2.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.