Fix assertions

This commit is contained in:
strangelookingnerd 2024-06-27 09:51:47 +02:00 committed by Oleg Kalnichevski
parent 185d4e32aa
commit 420910da4f
5 changed files with 9 additions and 9 deletions

View File

@ -27,7 +27,6 @@
package org.apache.hc.client5.http.impl.cache;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.hc.core5.io.Closer;

View File

@ -28,6 +28,7 @@ package org.apache.hc.client5.http.impl.cache;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.ByteArrayInputStream;
@ -170,7 +171,7 @@ class TestRFC5861Compliance {
final ClassicHttpResponse result = execute(req2);
assertTrue(HttpStatus.SC_OK != result.getCode());
assertNotEquals(HttpStatus.SC_OK, result.getCode());
}
@Test
@ -193,7 +194,7 @@ class TestRFC5861Compliance {
final ClassicHttpResponse result = execute(req2);
assertTrue(HttpStatus.SC_OK != result.getCode());
assertNotEquals(HttpStatus.SC_OK, result.getCode());
}
@Test
@ -216,7 +217,7 @@ class TestRFC5861Compliance {
final ClassicHttpResponse result = execute(req2);
assertTrue(HttpStatus.SC_OK != result.getCode());
assertNotEquals(HttpStatus.SC_OK, result.getCode());
}
@Test

View File

@ -359,7 +359,7 @@ class TestHttpRoute {
final HttpHost[] proxies3 = new HttpHost[]{ PROXY3, PROXY1, PROXY2 };
final HttpRoute route3 = new HttpRoute(TARGET1, LOCAL42, proxies3, false,
TunnelType.PLAIN, LayerType.LAYERED);
Assertions.assertEquals(route3.getHopCount(), 4, "C: hop count");
Assertions.assertEquals(4, route3.getHopCount(), "C: hop count");
Assertions.assertEquals(PROXY3 , route3.getHopTarget(0), "C: hop 0");
Assertions.assertEquals(PROXY1 , route3.getHopTarget(1), "C: hop 1");
Assertions.assertEquals(PROXY2 , route3.getHopTarget(2), "C: hop 2");

View File

@ -176,7 +176,7 @@ class TestHttpRequestBase {
final Set<String> methods = httpOptions.getAllowedMethods(response);
assertAll("Must all pass",
() -> assertFalse(methods.isEmpty()),
() -> assertEquals(methods.size(), 3),
() -> assertEquals(3, methods.size()),
() -> assertTrue(methods.containsAll(Stream.of("HEAD", "DELETE", "GET")
.collect(Collectors.toCollection(HashSet::new))))
);

View File

@ -404,9 +404,9 @@ class TestRedirectExec {
final ClassicHttpRequest request2 = allValues.get(1);
final ClassicHttpRequest request3 = allValues.get(2);
Assertions.assertSame(request, request1);
Assertions.assertEquals(request1.getMethod(), "PUT");
Assertions.assertEquals(request2.getMethod(), "GET");
Assertions.assertEquals(request3.getMethod(), "GET");
Assertions.assertEquals("PUT", request1.getMethod());
Assertions.assertEquals("GET", request2.getMethod());
Assertions.assertEquals("GET", request3.getMethod());
}
private static class HttpRequestMatcher implements ArgumentMatcher<ClassicHttpRequest> {