package Ġio . tol gee . api . v 2 . controllers . v 2 Projects Controller Ċ Ċ import Ġio . tol gee . constants . Mt ServiceType Ċ import Ġio . tol gee . controllers . Project Auth Controller Test Ċ import Ġio . tol gee . development . testData Builder . data . Mt Settings TestData Ċ import Ġio . tol gee . d tos . request . Machine Translation Language Props Dto Ċ import Ġio . tol gee . d tos . request . Set Machine Translation Settings Dto Ċ import Ġio . tol gee . fixtures . and Assert That Json Ċ import Ġio . tol gee . fixtures . and Is Ok Ċ import Ġio . tol gee . fixtures . and Pretty Print Ċ import Ġio . tol gee . fixtures . isValid Id Ċ 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 Ċ Ċ @ SpringBootTest Ċ @ Auto Configure MockMvc Ċ class ĠV 2 Projects Controller Machine Translation Settings Test Ġ: ĠProject Auth Controller Test () Ġ{ ĊĊĠ Ġlateinit Ġvar ĠtestData : ĠM t Settings TestData ĊĊĠ Ġ@ BeforeEach ĊĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠ Ġmock Properties () ĊĠĠĠ Ġinit TestData () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġinit TestData () Ġ{ ĊĠĠĠ ĠtestData Ġ= ĠM t Settings TestData () ĊĠĠĠ Ġtest DataService . save TestData ( testData . root ) ĊĠĠĠ Ġproject Supplier Ġ= Ġ{ ĠtestData . project Builder . self Ġ} ĊĠĠĠ Ġuser Account Ġ= ĠtestData . user ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġmock Properties () Ġ{ ĊĠĠĠ Ġaws Machine Translation Properties . default Enabled Ġ= Ġtrue ĊĠĠĠ Ġaws Machine Translation Properties . default Primary Ġ= Ġfalse ĊĠĠĠ Ġaws Machine Translation Properties . access Key Ġ= Ġ" dummy " ĊĠĠĠ Ġaws Machine Translation Properties . secret Key Ġ= Ġ" dummy " ĊĠĠĠ Ġgoogle Machine Translation Properties . default Enabled Ġ= Ġtrue ĊĠĠĠ Ġgoogle Machine Translation Properties . default Primary Ġ= Ġtrue ĊĠĠĠ Ġgoogle Machine Translation Properties . apiKey Ġ= Ġ" dummy " ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġfun Ġ` it Ġsets Ġthe Ġconfiguration `() Ġ{ ĊĠĠĠ Ġperform Auth Put ( ĊĠĠĠĠĠ Ġ"/ v 2 / projects /${ project . id }/ machine - translation - service - settings ", ĊĠĠĠĠĠ ĠSet Machine Translation Settings Dto ( ĊĠĠĠĠĠĠĠ ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠ ĠMachine Translation Language Props Dto ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtarget Language Id Ġ= Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprimary Service Ġ= ĠM t ServiceType . GOOGLE , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġenabled Services Ġ= Ġset Of ( Mt ServiceType . AWS , ĠM t ServiceType . GOOGLE ) ĊĠĠĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠĠĠ ĠMachine Translation Language Props Dto ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtarget Language Id Ġ= ĠtestData . english Language . id , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprimary Service Ġ= ĠM t ServiceType . GOOGLE , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġenabled Services Ġ= Ġset Of ( Mt ServiceType . AWS , ĠM t ServiceType . GOOGLE ) ĊĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ). and Is Ok . and Assert That Json Ġ{ ĊĠĠĠĠĠ Ġnode ("_ embedded . language Configs ") Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("[ 0 ]") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġnode (" target Language Id "). isValid Id ĊĠĠĠĠĠĠĠĠĠ Ġnode (" target Language Tag "). isEqualTo (" en ") ĊĠĠĠĠĠĠĠĠĠ Ġnode (" target Language Name "). isEqualTo (" English ") ĊĠĠĠĠĠĠĠĠĠ Ġnode (" primary Service "). isEqualTo (" GOOGLE ") ĊĠĠĠĠĠĠĠĠĠ Ġnode (" enabled Services "). isArray . isEqualTo (""" [ Ġ" GOOGLE ", Ġ" AWS " Ġ] """) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġnode ("[ 1 ]") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġnode (" target Language Id "). isNull () ĊĠĠĠĠĠĠĠĠĠ Ġnode (" primary Service "). isEqualTo (" GOOGLE ") ĊĠĠĠĠĠĠĠĠĠ Ġnode (" enabled Services "). isArray . isEqualTo (""" [ Ġ" GOOGLE ", Ġ" AWS " Ġ] """) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġfun Ġ` it Ġremoves Ġservice Ġfrom Ġthe Ġconfiguration `() Ġ{ ĊĠĠĠ Ġperform Auth Put ( ĊĠĠĠĠĠ Ġ"/ v 2 / projects /${ project . id }/ machine - translation - service - settings ", ĊĠĠĠĠĠ ĠSet Machine Translation Settings Dto ( ĊĠĠĠĠĠĠĠ ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠ ĠMachine Translation Language Props Dto ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtarget Language Id Ġ= ĠtestData . span ish Language . id , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprimary Service Ġ= ĠM t ServiceType . GOOGLE , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġenabled Services Ġ= Ġset Of ( Mt ServiceType . AWS ) ĊĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ). and Is Ok ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġ@ Project JWT Auth TestMethod ĊĠ Ġfun Ġ` it Ġreturns Ġthe Ġconfiguration `() Ġ{ ĊĠĠĠ Ġperform Auth Get ( ĊĠĠĠĠĠ Ġ"/ v 2 / projects /${ project . id }/ machine - translation - service - settings " ĊĠĠĠ Ġ). and Pretty Print . and Assert That Json Ġ{ ĊĠĠĠĠĠ Ġnode ("_ embedded . language Configs ") Ġ{ ĊĠĠĠĠĠĠĠ Ġnode ("[ 0 ]") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġnode (" target Language Id "). isNull () ĊĠĠĠĠĠĠĠĠĠ Ġnode (" primary Service "). isEqualTo (" GOOGLE ") ĊĠĠĠĠĠĠĠĠĠ Ġnode (" enabled Services "). isArray . isEqualTo (""" [ Ġ" GOOGLE ", Ġ" AWS " Ġ] """) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġnode ("[ 1 ]") Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġnode (" target Language Id "). isValid Id ĊĠĠĠĠĠĠĠĠĠ Ġnode (" target Language Tag "). isEqualTo (" de ") ĊĠĠĠĠĠĠĠĠĠ Ġnode (" target Language Name "). isEqualTo (" Ger man ") ĊĠĠĠĠĠĠĠĠĠ Ġnode (" primary Service "). isEqualTo (" AWS ") ĊĠĠĠĠĠĠĠĠĠ Ġnode (" enabled Services "). isArray . isEqualTo (""" [ Ġ" AWS " Ġ] """) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ