]> 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 18dff3851e0219ab882e806f64d62d21f3c31028..03dada67beb1d199fdd8828f74ead4a026d4fea3 100644 (file)
@@ -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"));