package Ġio . tol gee . api . v 2 . controllers . translations . v 2 Translations Controller Ċ Ċ import Ġio . tol gee . controllers . Project Auth Controller Test Ċ import Ġio . tol gee . development . testData Builder . data . Translations TestData Ċ import Ġio . tol gee . fixtures . and Assert Error Ċ import Ġio . tol gee . fixtures . and Assert That Json Ċ import Ġio . tol gee . fixtures . and Is BadRequest Ċ import Ġio . tol gee . fixtures . and Is Ok Ċ import Ġio . tol gee . fixtures . and Pretty Print Ċ import Ġio . tol gee . fixtures . node Ċ import Ġio . tol gee . testing . annotations . Project JWT Auth TestMethod Ċ import Ġorg . junit . jupiter . api . BeforeEach Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . springframework . boot . test . autoconfigure . web . servlet . Auto Configure MockMvc Ċ import Ġorg . springframework . boot . test . context . SpringBootTest Ċ import Ġjava . math . BigDecimal Ċ Ċ @ SpringBootTest Ċ @ Auto Configure MockMvc Ċ class ĠV 2 Translations Controller Filter Test Ġ: ĠProject Auth Controller Test ("/ v 2 / projects /") Ġ{ ĊĊĠ Ġlateinit Ġvar ĠtestData : ĠTrans lations TestData ĊĊĠ Ġ@ BeforeEach ĊĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠ ĠtestData Ġ= ĠTrans lations TestData () ĊĠĠĠ Ġthis . project Supplier Ġ= Ġ{ ĠtestData . project Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġkey Name `() Ġ{ ĊĠĠĠ ĠtestData . generate Lot Of Data () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter KeyName = key Ġ 1 8 "). and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠ Ġnode ("_ embedded . keys ") Ġ{ ĊĠĠĠĠĠĠĠ ĠisArray . has Size ( 1 ) ĊĠĠĠĠĠĠĠ Ġnode ("[ 0 ]. key Name "). isEqualTo (" key Ġ 1 8 ") ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 1 ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġkey Id `() Ġ{ ĊĠĠĠ ĠtestData . generate Lot Of Data () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter KeyId =${ testData . a Key . id } "). and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠ Ġnode ("_ embedded . keys ") Ġ{ ĊĠĠĠĠĠĠĠ ĠisArray . has Size ( 1 ) ĊĠĠĠĠĠĠĠ Ġnode ("[ 0 ]. key Name "). isEqualTo (" A Ġkey ") ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 1 ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġkey Name Ġcontaining Ġdot `() Ġ{ ĊĠĠĠ ĠtestData . add Key With Dot () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter KeyName = key . with . dots "). and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠ Ġnode ("_ embedded . keys ") Ġ{ ĊĠĠĠĠĠĠĠ ĠisArray . has Size ( 1 ) ĊĠĠĠĠĠĠĠ Ġnode ("[ 0 ]. key Name "). isEqualTo (" key . with . dots ") ĊĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 1 ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġun translated Ġany `() Ġ{ ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter Un translated Any = true ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 2 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġtranslated Ġany `() Ġ{ ĊĠĠĠ ĠtestData . add Key With Dot () ĊĠĠĠ ĠtestData . generate Lot Of Data () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter Translated Any = true & search = dot ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 0 ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter Translated Any = true ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isNumber . is GreaterThan ( BigDecimal ( 9 0 )) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġtranslated Ġin Ġlang `() Ġ{ ĊĠĠĠ ĠtestData . add Key With Dot () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter Translated In Lang = en ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. translations . en "). isNotNull ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 1 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġun translated Ġin Ġlang `() Ġ{ ĊĠĠĠ ĠtestData . add Key With Dot () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter Un translated In Lang = en ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. translations . de "). isNotNull ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 2 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġhas Screenshot `() Ġ{ ĊĠĠĠ ĠtestData . generate Lot Of Data () ĊĠĠĠ ĠtestData . add Keys With Screenshots () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? languages = en & filter Has Screenshot = true ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. screenshot Count "). isEqualTo ( 2 ) ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 2 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġhas No Screenshot `() Ġ{ ĊĠĠĠ ĠtestData . add Keys With Screenshots () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter Has No Screenshot = true ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. screenshot Count "). isEqualTo ( 0 ) ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 2 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġstate `() Ġ{ ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter State = de , RE VIEW ED ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. key Name "). isEqualTo (" A Ġkey ") ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 1 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġmultiple Ġstates `() Ġ{ ĊĠĠĠ ĠtestData . add Translations With States () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter State = de , TRANSL ATED & filter State = en , RE VIEW ED ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. key Name "). isEqualTo (" state Ġtest Ġkey Ġ 2 ") ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 1 ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter State = de , RE VIEW ED & filter State = en , RE VIEW ED ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. key Name "). isEqualTo (" state Ġtest Ġkey ") ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 1 ) ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter State = de , UN TRANSL ATED & filter State = en , RE VIEW ED ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. key Name "). isEqualTo (" state Ġtest Ġkey Ġ 3 ") ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 1 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġun translated Ġstate `() Ġ{ ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter State = de , UN TRANSL ATED ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. key Name "). isEqualTo (" Z Ġkey ") ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 1 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġtag `() Ġ{ ĊĠĠĠ ĠtestData . add F ew Keys With Tags () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter Tag = Cool Ġtag ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. key Name "). isEqualTo (" A Ġkey ") ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. key Tags [ 0 ]. name "). isEqualTo (" Cool Ġtag ") ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 1 ]. key Tags [ 0 ]. name "). isEqualTo (" Cool Ġtag ") ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 2 ]. key Tags [ 0 ]. name "). isEqualTo (" Cool Ġtag ") ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 3 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` filters Ġby Ġmultiple Ġtags `() Ġ{ ĊĠĠĠ ĠtestData . add F ew Keys With Tags () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter Tag = Cool Ġtag & filter Tag = Another Ġcool Ġtag ") ĊĠĠĠĠĠ Ġ. and Pretty Print . and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. key Name "). isEqualTo (" A Ġkey ") ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 0 ]. key Tags [ 0 ]. name "). isEqualTo (" Cool Ġtag ") ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 1 ]. key Tags [ 0 ]. name "). isEqualTo (" Another Ġcool Ġtag ") ĊĠĠĠĠĠĠĠ Ġnode ("_ embedded . keys [ 2 ]. key Tags [ 0 ]. name "). isEqualTo (" Cool Ġtag ") ĊĠĠĠĠĠĠĠ Ġnode (" page . total Elements "). isEqualTo ( 4 ) ĊĠĠĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` valid ates Ġfilter Ġstate `() Ġ{ ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter State = de , RE VIEW ED , a ") ĊĠĠĠĠĠ Ġ. and Is BadRequest . and Assert Error . has Code (" filter _ by _ value _ state _ not _ valid ") ĊĊĠĠĠ Ġperform Project Auth Get ("/ translations ? filter State = de , REV II III IEW ED ") ĊĠĠĠĠĠ Ġ. and Is BadRequest . and Assert Error . has Code (" filter _ by _ value _ state _ not _ valid ") ĊĠ Ġ} Ċ } Ċ