updatePriceSetTaskServlet = new UpdatePriceSetTaskServlet(priceSetDao);
}
@Test
public void testDoPost() throws Exception {
PriceSet priceSet = new PriceSet();
when(priceSetDao.get(2L, new Key<User>(User.class, 1L))).thenReturn(priceSet);
when(httpServletRequest.getParameter("userID")).thenReturn("1");
when(httpServletRequest.getParameter("priceSetID")).thenReturn("2");
when(httpServletRequest.getParameter("characterID")).thenReturn("3");
when(httpServletRequest.getParameter("characterName")).thenReturn("characterName");
when(httpServletRequest.getParameter("corporationID")).thenReturn("4");
when(httpServletRequest.getParameter("corporationName")).thenReturn("corporationName");
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());