mirror of https://github.com/shred/acme4j
Add another header unit test
parent
e946e6397c
commit
ef7070a3b6
|
@ -26,6 +26,7 @@ import java.net.URI;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -213,6 +214,20 @@ public class DefaultConnectionTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that no link headers are properly handled.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testGetNoLink() {
|
||||||
|
Map<String, List<String>> headers = Collections.emptyMap();
|
||||||
|
when(mockUrlConnection.getHeaderFields()).thenReturn(headers);
|
||||||
|
|
||||||
|
try (DefaultConnection conn = new DefaultConnection(mockHttpConnection)) {
|
||||||
|
conn.conn = mockUrlConnection;
|
||||||
|
assertThat(conn.getLinks("something"), is(nullValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that no Location header returns {@code null}.
|
* Test that no Location header returns {@code null}.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue