updateBlueprintTaskServlet = new UpdateBlueprintTaskServlet(blueprintDao);
}
@Test
public void testDoPost() throws Exception {
Blueprint blueprint = new Blueprint();
when(blueprintDao.get(2L, new Key<User>(User.class, 1L))).thenReturn(blueprint);
when(httpServletRequest.getParameter("userID")).thenReturn("1");
when(httpServletRequest.getParameter("blueprintID")).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");
updateBlueprintTaskServlet.doPost(httpServletRequest, httpServletResponse);
verify(blueprintDao).putWithoutChecks(blueprint);
CharacterInfo characterInfo = blueprint.getAttachedCharacterInfo();
assertNotNull(characterInfo);
assertEquals(Long.valueOf(3), characterInfo.getCharacterID());
assertEquals("characterName", characterInfo.getName());
assertEquals(Long.valueOf(4), characterInfo.getCorporationID());
assertEquals("corporationName", characterInfo.getCorporationName());