X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=tests%2Fclub%2Fwpia%2Fgigi%2Fpages%2Forga%2FTestOrgManagement.java;h=164facf6d179f9513726c3889341c760d8b45438;hp=6565d25fe04ed41a88933560823a661709d48d29;hb=7ea933e2e4cac62194d860cf213c1fd106ce76c5;hpb=86c54e084577b712268320f990facc8e9a09aec6 diff --git a/tests/club/wpia/gigi/pages/orga/TestOrgManagement.java b/tests/club/wpia/gigi/pages/orga/TestOrgManagement.java index 6565d25f..164facf6 100644 --- a/tests/club/wpia/gigi/pages/orga/TestOrgManagement.java +++ b/tests/club/wpia/gigi/pages/orga/TestOrgManagement.java @@ -17,6 +17,7 @@ import org.junit.After; import org.junit.Test; import club.wpia.gigi.GigiApiException; +import club.wpia.gigi.dbObjects.CATS.CATSType; import club.wpia.gigi.dbObjects.Certificate; import club.wpia.gigi.dbObjects.Country; import club.wpia.gigi.dbObjects.Country.CountryCodeType; @@ -286,4 +287,16 @@ public class TestOrgManagement extends OrgTest { uc = get(cookie, CreateOrgPage.DEFAULT_PATH); assertEquals(403, ((HttpURLConnection) uc).getResponseCode()); } + + @Test + public void testAgentWithoutValidChallenge() throws IOException, GigiApiException { + User agent = User.getById(createVerificationUser("testworker", "testname", createUniqueName() + "@testdom.com", TEST_PASSWORD)); + addChallenge(agent.getId(), CATSType.ORG_AGENT_CHALLENGE); + loginCertificate = null; + cookie = cookieWithCertificateLogin(agent); + URLConnection uc = get(cookie, ViewOrgPage.DEFAULT_PATH); + assertEquals(403, ((HttpURLConnection) uc).getResponseCode()); + uc = get(cookie, CreateOrgPage.DEFAULT_PATH); + assertEquals(403, ((HttpURLConnection) uc).getResponseCode()); + } }