package Ġcom . graph ene . reader . store . key . elasticsearch . selector Ċ Ċ import Ġcom . graph ene . common . rule . Graph ene Rules Ċ import Ġcom . graph ene . common . utils . DateTime Utils Ċ import Ġio . kot lint est . matchers . collections . should Contain All Ċ import Ġorg . junit . jupiter . api . Test Ċ Ċ internal Ġclass ĠRol ling Key Selector Test Ġ{ ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` should Ġreturn Ġsingle Ġindex Ġif Ġrotation Ġis Ġdisable `() Ġ{ ĊĠĠĠ Ġ// Ġgiven ĊĠĠĠ Ġval Ġrolling Key Selector Ġ= ĠRol ling Key Selector ( Key Selector Property ( Graph ene Rules . Key . DEFAULT _ TYPE , ĠGraph ene Rules . Key . ROT ATION _ NONE )) ĊĊĠĠĠ Ġ// Ġwhen ĊĠĠĠ Ġval Ġindexes Ġ= Ġrolling Key Selector . select (" index ", Ġ" tenant ", ĠDateTime Utils . from (" 2 0 1 9 - 1 2 - 0 1 Ġ 1 0 : 0 0 : 0 0 "), ĠDateTime Utils . from (" 2 0 1 9 - 1 2 - 3 0 Ġ 1 0 : 0 0 : 0 0 ")) ĊĊĠĠĠ Ġ// Ġthen ĊĠĠĠ Ġset Of (" index ") Ġshould Contain All Ġindexes ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġinternal Ġfun Ġ` should Ġreturn Ġtime Ġbased Ġindex Ġif Ġrotation Ġis Ġenable `() Ġ{ ĊĠĠĠ Ġ// Ġgiven ĊĠĠĠ Ġval Ġrolling Key Selector Ġ= ĠRol ling Key Selector ( Key Selector Property ( Graph ene Rules . Key . DEFAULT _ TYPE , ĠGraph ene Rules . Key . ROT ATION _ 1 W )) ĊĊĠĠĠ Ġ// Ġwhen ĊĠĠĠ Ġval Ġindexes Ġ= Ġrolling Key Selector . select (" index ", Ġ" tenant ", ĠDateTime Utils . from (" 2 0 1 9 - 1 2 - 0 1 Ġ 1 0 : 0 0 : 0 0 "), ĠDateTime Utils . from (" 2 0 1 9 - 1 2 - 3 0 Ġ 1 0 : 0 0 : 0 0 ")) ĊĊĠĠĠ Ġ// Ġthen ĊĠĠĠ Ġset Of (" index _ tenant _ 2 0 1 9 - w 4 8 ", Ġ" index _ tenant _ 2 0 1 9 - w 4 9 ", Ġ" index _ tenant _ 2 0 1 9 - w 5 0 ", Ġ" index _ tenant _ 2 0 1 9 - w 5 1 ", Ġ" index _ tenant _ 2 0 1 9 - w 5 2 ", Ġ" index _ tenant _ 2 0 2 0 - w 0 1 ") Ġshould Contain All Ġindexes ĊĠ Ġ} Ċ } Ċ