package Ġro cks . le ight . core . server Ċ Ċ import Ġro cks . le ight . core . api . server . IL ink Generator Ċ import Ġro cks . le ight . core . container . Container Factory Ċ import Ġkotlin . test . Test Ċ import Ġkotlin . test . assertEquals Ċ import Ġkotlin . test . assertSame Ċ import Ġkotlin . time . Experimental Time Ċ Ċ @ Experimental Time Ċ class ĠLink Generator Test Ġ{ Ċ ĉ @ Test Ċ ĉ fun Ġ` container Ġsupport `() Ġ{ Ċĉ ĉ val Ġcontainer Ġ= ĠContainer Factory . container () Ċĉ ĉ assertSame ( container . create ( IL ink Generator :: class ), Ġcontainer . create ( IL ink Generator :: class )) Ċ ĉ } ĊĊ ĉ @ Test Ċ ĉ fun Ġ` url Ġgenerator `() Ġ{ Ċĉ ĉ Container Factory . container (). apply Ġ{ Ċĉĉ ĉ register ( HttpServer Config :: class ) Ġ{ Ċĉĉĉ ĉ HttpServer Config ( 1 2 3 4 , Ġ" https :// tem ny - sv et : 4 3 2 1 ") Ċĉĉ ĉ } Ċĉĉ ĉ create ( IL ink Generator :: class ). apply Ġ{ Ċĉĉĉ ĉ assertEquals (" https :// tem ny - sv et : 4 3 2 1 / ch l up at % C 3 % A 1 + p % C 3 % AD % C 4 % 8 Da ", Ġencoded (" ch l up at Ã¡ Ġp ÃŃ Äį a "). toString ()) Ċĉĉĉ ĉ assertEquals (" https :// tem ny - sv et : 4 3 2 1 / ch l up at % C 3 % A 1 + p % C 3 % AD % C 4 % 8 Da ? aho j = true & foo = bar ", Ġencoded (" ch l up at Ã¡ Ġp ÃŃ Äį a ") Ġ{ Ġset (" aho j ", Ġ" true "); Ġset (" foo ", Ġ" bar ") Ġ}. toString ()) Ċĉĉĉ ĉ assertEquals (" https :// tem ny - sv et : 4 3 2 1 / abc / cde / f ga Ġa / q ? kop a = h ov en ", Ġlink (" abc / cde / f ga Ġa / q ") Ġ{ Ġset (" kop a ", Ġ" h ov en ") Ġ}. toString ()) Ċĉĉĉ ĉ assertEquals (" https :// tem ny - sv et : 4 3 2 1 / abc / cde / f ga Ġa / q ", Ġlink (" abc / cde / f ga Ġa / q "). toString ()) Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } Ċ } Ċ