package Ġuk . gov . just ice . digital . h mp ps . manage off ences api . model . external . sd rs Ċ Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . Test Ċ Ċ class ĠOff ence Test Ġ{ ĊĠ Ġ@ Test ĊĠ Ġfun Ġ` Check Ġcategory Ġand Ġsub category Ġwhen Ġno Ġmo j Stats Code Ġexists `() Ġ{ ĊĠĠĠ Ġval Ġof Ġ= ĠOff ence ( code Ġ= Ġ" A 1 2 3 4 ", Ġoff ence Revision Id Ġ= Ġ 1 ) ĊĠĠĠ ĠassertThat ( of . category ). isNull () ĊĠĠĠ ĠassertThat ( of . sub Category ). isNull () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` Check Ġcategory Ġand Ġsub category Ġwhen Ġno Ġsub category `() Ġ{ ĊĠĠĠ Ġval Ġof Ġ= ĠOff ence ( code Ġ= Ġ" A 1 2 3 4 ", Ġoff ence Revision Id Ġ= Ġ 1 , Ġmo j Stats Code Ġ= Ġ" 0 1 2 /") ĊĠĠĠ ĠassertThat ( of . category ). isEqualTo ( 1 2 ) ĊĠĠĠ ĠassertThat ( of . sub Category ). isNull () ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` Check Ġcategory Ġand Ġsub category Ġwhen Ġno Ġcategory `() Ġ{ ĊĠĠĠ Ġval Ġof Ġ= ĠOff ence ( code Ġ= Ġ" A 1 2 3 4 ", Ġoff ence Revision Id Ġ= Ġ 1 , Ġmo j Stats Code Ġ= Ġ"/ 0 2 ") ĊĠĠĠ ĠassertThat ( of . category ). isNull () ĊĠĠĠ ĠassertThat ( of . sub Category ). isEqualTo ( 2 ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġ` Check Ġcategory Ġand Ġsub category Ġwhen Ġboth Ġexist `() Ġ{ ĊĠĠĠ Ġval Ġof Ġ= ĠOff ence ( code Ġ= Ġ" A 1 2 3 4 ", Ġoff ence Revision Id Ġ= Ġ 1 , Ġmo j Stats Code Ġ= Ġ" 0 1 2 / 0 2 ") ĊĠĠĠ ĠassertThat ( of . category ). isEqualTo ( 1 2 ) ĊĠĠĠ ĠassertThat ( of . sub Category ). isEqualTo ( 2 ) ĊĠ Ġ} Ċ } Ċ