package Ġpc im c io ch . gitlab ci . dsl Ċ Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . junit . jupiter . api . assert Throws Ċ Ċ internal Ġclass ĠDuration Test Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġfor bid Ġnegative Ġdur ations `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThrows < IllegalArgumentException > Ġ{ ĠDuration ( years Ġ= Ġ- 1 ) Ġ} ĊĠĠĠĠĠĠĠ ĠassertThrows < IllegalArgumentException > Ġ{ ĠDuration ( months Ġ= Ġ- 1 ) Ġ} ĊĠĠĠĠĠĠĠ ĠassertThrows < IllegalArgumentException > Ġ{ ĠDuration ( days Ġ= Ġ- 1 ) Ġ} ĊĠĠĠĠĠĠĠ ĠassertThrows < IllegalArgumentException > Ġ{ ĠDuration ( hours Ġ= Ġ- 1 ) Ġ} ĊĠĠĠĠĠĠĠ ĠassertThrows < IllegalArgumentException > Ġ{ ĠDuration ( minutes Ġ= Ġ- 1 ) Ġ} ĊĠĠĠĠĠĠĠ ĠassertThrows < IllegalArgumentException > Ġ{ ĠDuration ( seconds Ġ= Ġ- 1 ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġfor bid Ġzero Ġdur ations `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThrows < IllegalArgumentException > Ġ{ ĠDuration ( years Ġ= Ġ 0 ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġformat Ġsimple Ġduration `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( years Ġ= Ġ 1 ). toString ()). isEqualTo (" 1 Ġy ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( years Ġ= Ġ 5 ). toString ()). isEqualTo (" 5 Ġy ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( months Ġ= Ġ 1 ). toString ()). isEqualTo (" 1 Ġmo ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( months Ġ= Ġ 5 ). toString ()). isEqualTo (" 5 Ġmo ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( days Ġ= Ġ 1 ). toString ()). isEqualTo (" 1 Ġday ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( days Ġ= Ġ 5 ). toString ()). isEqualTo (" 5 Ġday ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( hours Ġ= Ġ 1 ). toString ()). isEqualTo (" 1 Ġhr ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( hours Ġ= Ġ 5 ). toString ()). isEqualTo (" 5 Ġhr ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( minutes Ġ= Ġ 1 ). toString ()). isEqualTo (" 1 Ġmin ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( minutes Ġ= Ġ 5 ). toString ()). isEqualTo (" 5 Ġmin ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( seconds Ġ= Ġ 1 ). toString ()). isEqualTo (" 1 Ġsec ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( seconds Ġ= Ġ 5 ). toString ()). isEqualTo (" 5 Ġsec ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġformat Ġcomplex Ġdur ations `() Ġ{ ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( years Ġ= Ġ 1 , Ġmonths Ġ= Ġ 2 , Ġdays Ġ= Ġ 3 , Ġhours Ġ= Ġ 4 , Ġminutes Ġ= Ġ 5 , Ġseconds Ġ= Ġ 6 ). toString ()). isEqualTo (" 1 Ġy Ġ 2 Ġmo Ġ 3 Ġday Ġ 4 Ġhr Ġ 5 Ġmin Ġ 6 Ġsec ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( years Ġ= Ġ 1 0 , Ġminutes Ġ= Ġ 5 0 , Ġseconds Ġ= Ġ 6 0 ). toString ()). isEqualTo (" 1 0 Ġy Ġ 5 0 Ġmin Ġ 6 0 Ġsec ") ĊĠĠĠĠĠĠĠ ĠassertThat ( Duration ( minutes Ġ= Ġ 3 6 0 0 0 0 ). toString ()). isEqualTo (" 3 6 0 0 0 0 Ġmin ") ĊĠĠĠ Ġ} Ċ }