@@ -117,6 +117,15 @@ void aliasMode() throws IOException {
117
117
assertEquals (str , wireToString (bytes ));
118
118
}
119
119
120
+ @ Test
121
+ void serviceModeWithoutParameters () throws IOException {
122
+ String str = "1 ." ;
123
+ byte [] bytes = stringToWire (str );
124
+ byte [] expected = new byte [] {0 , 1 , 0 };
125
+ assertArrayEquals (expected , bytes );
126
+ assertEquals (str , wireToString (bytes ));
127
+ }
128
+
120
129
@ Test
121
130
void serviceModePort () throws IOException {
122
131
String str = "1 . port=8443" ;
@@ -319,6 +328,7 @@ void masterFormatParsing() throws IOException {
319
328
+ "test.net. 86400 IN NS ns1.test.net.\n "
320
329
+ "test.net. 300 IN HTTPS 0 www.test.net.\n "
321
330
+ "test.net. 300 IN SVCB 1 . alpn=h2\n "
331
+ + "test.net. 300 IN HTTPS 1 .\n "
322
332
+ "www.test.net. 300 IN A 1.2.3.4\n " ;
323
333
Master m = new Master (new ByteArrayInputStream (str .getBytes ()));
324
334
@@ -333,6 +343,9 @@ void masterFormatParsing() throws IOException {
333
343
assertEquals (Type .SVCB , r .getType ());
334
344
assertEquals ("1 . alpn=h2" , r .rdataToString ());
335
345
r = m .nextRecord ();
346
+ assertEquals (Type .HTTPS , r .getType ());
347
+ assertEquals ("1 ." , r .rdataToString ());
348
+ r = m .nextRecord ();
336
349
assertEquals (Type .A , r .getType ());
337
350
assertEquals ("1.2.3.4" , r .rdataToString ());
338
351
r = m .nextRecord ();
@@ -351,12 +364,6 @@ void extraQuotesInParamValues() {
351
364
assertThrows (TextParseException .class , () -> stringToWire (str ));
352
365
}
353
366
354
- @ Test
355
- void serviceModeWithoutParameters () {
356
- String str = "1 aliasmode.example.com." ;
357
- assertThrows (TextParseException .class , () -> stringToWire (str ));
358
- }
359
-
360
367
@ Test
361
368
void aliasModeWithParameters () {
362
369
String str = "0 . alpn=h3" ;
@@ -465,12 +472,6 @@ void emptyString() {
465
472
assertThrows (TextParseException .class , () -> stringToWire (str ));
466
473
}
467
474
468
- @ Test
469
- void noParamValues () {
470
- String str = "1 ." ;
471
- assertThrows (TextParseException .class , () -> stringToWire (str ));
472
- }
473
-
474
475
@ Test
475
476
void svcPriorityTooHigh () {
476
477
String str = "65536 . port=443" ;
0 commit comments