Package lv.odylab.evemanage.domain.user

Examples of lv.odylab.evemanage.domain.user.CharacterInfo


    }

    @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);
        verify(priceSetDao).putWithoutChecks(priceSet);
        assertEquals(Long.valueOf(3), attachedCharacterInfo.getCharacterID());
        assertEquals("characterName", attachedCharacterInfo.getName());
        assertEquals(Long.valueOf(4), attachedCharacterInfo.getCorporationID());
        assertEquals("corporationName", attachedCharacterInfo.getCorporationName());
        assertEquals("corporationTicker", attachedCharacterInfo.getCorporationTicker());
        assertEquals(Long.valueOf(5), attachedCharacterInfo.getAllianceID());
        assertEquals("allianceName", attachedCharacterInfo.getAllianceName());
    }
View Full Code Here


    }

    @Test
    public void testDoPost_WrongCharacter() throws Exception {
        PriceSet priceSet = new PriceSet();
        CharacterInfo attachedCharacterInfo = new CharacterInfo();
        attachedCharacterInfo.setId(2L);
        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))).thenThrow(new NotFoundException(null));
        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);
        verify(blueprintDao).putWithoutChecks(blueprint);
        assertEquals(Long.valueOf(3), attachedCharacterInfo.getCharacterID());
        assertEquals("characterName", attachedCharacterInfo.getName());
        assertEquals(Long.valueOf(4), attachedCharacterInfo.getCorporationID());
        assertEquals("corporationName", attachedCharacterInfo.getCorporationName());
        assertEquals("corporationTicker", attachedCharacterInfo.getCorporationTicker());
        assertEquals(Long.valueOf(5), attachedCharacterInfo.getAllianceID());
        assertEquals("allianceName", attachedCharacterInfo.getAllianceName());
    }
View Full Code Here

        when(httpServletRequest.getParameter("corporationTicker")).thenReturn("corporationTicker");
        when(httpServletRequest.getParameter("allianceID")).thenReturn("5");
        when(httpServletRequest.getParameter("allianceName")).thenReturn("allianceName");
        updatePriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(priceSetDao).putWithoutChecks(priceSet);
        CharacterInfo characterInfo = priceSet.getAttachedCharacterInfo();
        assertNotNull(characterInfo);
        assertEquals(Long.valueOf(3), characterInfo.getCharacterID());
        assertEquals("characterName", characterInfo.getName());
        assertEquals(Long.valueOf(4), characterInfo.getCorporationID());
        assertEquals("corporationName", characterInfo.getCorporationName());
        assertEquals("corporationTicker", characterInfo.getCorporationTicker());
        assertEquals(Long.valueOf(5), characterInfo.getAllianceID());
        assertEquals("allianceName", characterInfo.getAllianceName());
    }
View Full Code Here

        when(httpServletRequest.getParameter("priceSetID")).thenReturn("2");
        when(httpServletRequest.getParameter("characterID")).thenReturn("3");
        when(httpServletRequest.getParameter("characterName")).thenReturn("characterName");
        updatePriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(priceSetDao).putWithoutChecks(priceSet);
        CharacterInfo characterInfo = priceSet.getAttachedCharacterInfo();
        assertNotNull(characterInfo);
        assertEquals(Long.valueOf(3), characterInfo.getCharacterID());
        assertEquals("characterName", characterInfo.getName());
        assertNull(characterInfo.getCorporationID());
        assertNull(characterInfo.getCorporationName());
        assertNull(characterInfo.getCorporationTicker());
        assertNull(characterInfo.getAllianceID());
        assertNull(characterInfo.getAllianceName());
    }
View Full Code Here

    }

    @Test
    public void testDoPost_WrongCharacter() throws Exception {
        Blueprint blueprint = new Blueprint();
        CharacterInfo attachedCharacterInfo = new CharacterInfo();
        attachedCharacterInfo.setId(2L);
        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))).thenThrow(new NotFoundException(null));
        checkBlueprintTaskServlet.doPost(httpServletRequest, httpServletResponse);
View Full Code Here

        when(httpServletRequest.getParameter("corporationID")).thenReturn("4");
        when(httpServletRequest.getParameter("corporationName")).thenReturn("corporationName");
        when(httpServletRequest.getParameter("corporationTicker")).thenReturn("corporationTicker");
        updatePriceSetTaskServlet.doPost(httpServletRequest, httpServletResponse);
        verify(priceSetDao).putWithoutChecks(priceSet);
        CharacterInfo characterInfo = priceSet.getAttachedCharacterInfo();
        assertNotNull(characterInfo);
        assertEquals(Long.valueOf(3), characterInfo.getCharacterID());
        assertEquals("characterName", characterInfo.getName());
        assertEquals(Long.valueOf(4), characterInfo.getCorporationID());
        assertEquals("corporationName", characterInfo.getCorporationName());
        assertEquals("corporationTicker", characterInfo.getCorporationTicker());
        assertNull(characterInfo.getAllianceID());
        assertNull(characterInfo.getAllianceName());
    }
View Full Code Here

    @Test
    public void testSetMainCharacter() {
        Key<lv.odylab.evemanage.domain.user.User> userKey = new Key<lv.odylab.evemanage.domain.user.User>(lv.odylab.evemanage.domain.user.User.class, 1);
        lv.odylab.evemanage.domain.user.User user = new lv.odylab.evemanage.domain.user.User();
        List<CharacterInfo> characterInfos = new ArrayList<CharacterInfo>();
        CharacterInfo characterInfo1 = new CharacterInfo();
        characterInfo1.setId(1L);
        characterInfo1.setName("characterName1");
        CharacterInfo characterInfo2 = new CharacterInfo();
        characterInfo2.setId(2L);
        characterInfo2.setName("characterName2");
        characterInfos.add(characterInfo1);
        characterInfos.add(characterInfo2);
        user.setCharacterInfos(characterInfos);

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

    @Test
    public void testSetMainCharacter_NotExisting() {
        Key<lv.odylab.evemanage.domain.user.User> userKey = new Key<lv.odylab.evemanage.domain.user.User>(lv.odylab.evemanage.domain.user.User.class, 1);
        lv.odylab.evemanage.domain.user.User user = new lv.odylab.evemanage.domain.user.User();
        List<CharacterInfo> characterInfos = new ArrayList<CharacterInfo>();
        CharacterInfo characterInfo1 = new CharacterInfo();
        characterInfo1.setName("characterName1");
        characterInfos.add(characterInfo1);
        user.setCharacterInfos(characterInfos);

        when(userDao.get(userKey)).thenReturn(user);
        userManagementService.setMainCharacter("characterNameX", userKey);
View Full Code Here

    @Test
    public void testSynchronizeMainCharacter_NoCharacters_WithMainCharacter() {
        Key<User> userKey = new Key<User>(User.class, 1);
        User user = new User();
        CharacterInfo characterInfo = new CharacterInfo();
        characterInfo.setId(1L);
        characterInfo.setCharacterID(1L);
        user.setMainCharacterInfo(characterInfo);
        List<Character> characters = new ArrayList<Character>();

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

TOP

Related Classes of lv.odylab.evemanage.domain.user.CharacterInfo

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.