]> WPIA git - gigi.git/blobdiff - tests/org/cacert/gigi/ping/TestHTTP.java
fix: Avoid NPE when handling the HTTP response in tests
[gigi.git] / tests / org / cacert / gigi / ping / TestHTTP.java
index a1c5c7ae8e325700a20d2ab319f7c4965fb463d0..03dada67beb1d199fdd8828f74ead4a026d4fea3 100644 (file)
@@ -74,7 +74,7 @@ public class TestHTTP extends PingTest {
                 "&adddomain&csrf=" + csrf;
         String p2 = sendDomainForm(content);
 
-        TestMail mail = getMailReciever().receive();
+        TestMail mail = getMailReceiver().receive();
         if (emailVariant == 0) {
             mail.verify();
         }
@@ -98,6 +98,7 @@ public class TestHTTP extends PingTest {
             }
             if (dpc == null) {
                 fail("Http config not found");
+                return;
             }
             String res = executeBasicWebInteraction(cookie, p2, "configId=" + dpc.getId());
             assertThat(res, containsString("only allowed after"));
@@ -154,7 +155,7 @@ public class TestHTTP extends PingTest {
             BufferedReader br = new BufferedReader(new InputStreamReader(s0.getInputStream(), "UTF-8"));
             String fst = br.readLine();
             assertEquals("GET /cacert-" + m.group(1) + ".txt HTTP/1.1", fst);
-            while ( !br.readLine().equals("")) {
+            while ( !"".equals(br.readLine())) {
             }
             String res = m.group(2);
             PrintWriter out = new PrintWriter(new OutputStreamWriter(s0.getOutputStream(), "UTF-8"));
@@ -172,7 +173,7 @@ public class TestHTTP extends PingTest {
         }
         waitForPings(2);
 
-        TestMail mail = getMailReciever().receive();
+        TestMail mail = getMailReceiver().receive();
         mail.verify();
 
         String newcontent = IOUtils.readURL(get(p2));