Skip to content

Commit 6307bba

Browse files
committed
Add some whitespace in test-http-versions-config for readability
1 parent 241a44b commit 6307bba

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/aleph/http_test.clj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,6 +1322,7 @@
13221322

13231323
(deftest test-http-versions-config
13241324
(testing "ssl-context as options map"
1325+
13251326
(testing "with different HTTP versions in ALPN config"
13261327
(let [result (try-start-server
13271328
{:http-versions [:http2]
@@ -1330,6 +1331,7 @@
13301331
(netty/application-protocol-config [:http1]))})]
13311332
(is (instance? ExceptionInfo result))
13321333
(is (= "Some desired HTTP versions are not part of ALPN config." (ex-message result)))))
1334+
13331335
(testing "with different preference order in ALPN config"
13341336
(let [result (try-start-server
13351337
{:http-versions [:http2 :http1]
@@ -1338,6 +1340,7 @@
13381340
(netty/application-protocol-config [:http1 :http2]))})]
13391341
(is (instance? ExceptionInfo result))
13401342
(is (= "Desired HTTP version preference order differs from ALPN config." (ex-message result)))))
1343+
13411344
(testing "with extra HTTP versions in the ALPN config"
13421345
(let [result (try-start-server
13431346
{:http-versions [:http1]
@@ -1346,19 +1349,23 @@
13461349
(netty/application-protocol-config [:http1 :http2]))})]
13471350
(is (instance? ExceptionInfo result))
13481351
(is (= "ALPN config contains more HTTP versions than desired." (ex-message result)))))
1352+
13491353
(testing "with matching ALPN config"
13501354
(let [result (try-start-server
13511355
{:http-versions [:http2 :http1]
13521356
:ssl-context (assoc test-ssl/server-ssl-context-opts
13531357
:application-protocol-config
13541358
(netty/application-protocol-config [:http2 :http1]))})]
13551359
(is (= :started result))))
1360+
13561361
(testing "with no ALPN config"
13571362
(let [result (try-start-server
13581363
{:http-versions [:http2 :http1]
13591364
:ssl-context test-ssl/server-ssl-context-opts})]
13601365
(is (= :started result)))))
1366+
13611367
(testing "ssl-context as SslContext instance"
1368+
13621369
(testing "with different HTTP versions in ALPN config"
13631370
(let [result (try-start-server
13641371
{:http-versions [:http2]
@@ -1368,6 +1375,7 @@
13681375
(netty/application-protocol-config [:http1])))})]
13691376
(is (instance? ExceptionInfo result))
13701377
(is (= "Some desired HTTP versions are not part of ALPN config." (ex-message result)))))
1378+
13711379
(testing "with different preference order in ALPN config"
13721380
(let [result (try-start-server
13731381
{:http-versions [:http2 :http1]
@@ -1377,6 +1385,7 @@
13771385
(netty/application-protocol-config [:http1 :http2])))})]
13781386
(is (instance? ExceptionInfo result))
13791387
(is (= "Desired HTTP version preference order differs from ALPN config." (ex-message result)))))
1388+
13801389
(testing "with extra HTTP versions in the ALPN config"
13811390
(let [result (try-start-server
13821391
{:http-versions [:http1]
@@ -1386,6 +1395,7 @@
13861395
(netty/application-protocol-config [:http1 :http2])))})]
13871396
(is (instance? ExceptionInfo result))
13881397
(is (= "ALPN config contains more HTTP versions than desired." (ex-message result)))))
1398+
13891399
(testing "with matching ALPN config"
13901400
(let [result (try-start-server
13911401
{:http-versions [:http2 :http1]
@@ -1394,29 +1404,34 @@
13941404
:application-protocol-config
13951405
(netty/application-protocol-config [:http2 :http1])))})]
13961406
(is (= :started result))))
1407+
13971408
(testing "with no ALPN config"
13981409
(let [result (try-start-server
13991410
{:http-versions [:http2 :http1]
14001411
:ssl-context test-ssl/server-ssl-context})]
14011412
(is (instance? ExceptionInfo result))
14021413
(is (= "Some desired HTTP versions are not part of ALPN config." (ex-message result))))))
1414+
14031415
(testing "HTTP/2 without ssl-context"
14041416
(let [result (try-start-server
14051417
{:http-versions [:http2]})]
14061418
(is (instance? IllegalArgumentException result))
14071419
(is (= "HTTP/2 requires ssl-context to be given or use-h2c? to be true." (ex-message result)))))
1420+
14081421
(testing "HTTP/2 without ssl-context but with h2c"
14091422
(let [result (try-start-server
14101423
{:use-h2c? true
14111424
:http-versions [:http2]})]
14121425
(is (= :started result))))
1426+
14131427
(testing "HTTP/2 with ssl-context *and* with h2c"
14141428
(let [result (try-start-server
14151429
{:use-h2c? true
14161430
:http-versions [:http2]
14171431
:ssl-context test-ssl/server-ssl-context-opts})]
14181432
(is (instance? IllegalArgumentException result))
14191433
(is (= "use-h2c? must not be true when ssl-context is given." (ex-message result)))))
1434+
14201435
(testing "h2c without HTTP/2"
14211436
(let [result (try-start-server
14221437
{:use-h2c? true

0 commit comments

Comments
 (0)