Login extends AccessControlUsecase { protected void initParameters() { super.initParameters(); try { String pubId = new URLInformation().getPublicationId(); if (getSession().existsPublication(pubId)) { Publication publication = getSession().getPublication(pubId); setParameter(PUBLICATION, publication); } Identity identity = Identity.getIdentity(this.request.getSession(false)); if (identity != null && identity.getUser() != null) { setParameter(CURRENT_USER, identity.getUser()); } } catch (Exception e) { throw new RuntimeException(e); } }    }
@Ignore("Find a way to test usecase") @Test public void testInitParameters(){ Login login = new Login(); login.initParameters(); String pubName = login.getParameterAsString("Publication"); assertEquals("test", pubName); }