package Ġcom . tester um . file _ service . mapper . file _ to _ business Ċ Ċ import Ġcom . tester um . file _ service . mapper . file _ to _ business . common . File To Business Phase Mapper Ċ import Ġcom . tester um . file _ service . mapper . file _ to _ business . common . File To Business Step Call Mapper Ċ import Ġcom . tester um . model . infrastructure . path . Path Ċ import Ġcom . tester um . model . step . Comp osed Step Def Ċ import Ġcom . tester um . model . text . Step Pattern Ċ import Ġcom . tester um . model . text . parts . Param Step Pattern Part Ċ import Ġcom . tester um . model . text . parts . Step Pattern Part Ċ import Ġcom . tester um . model . text . parts . Text Step Pattern Part Ċ import Ġcom . tester um . model . text . parts . param _ meta . Type Meta Factory Ċ import Ġcom . tester um . model . util . Step Hash Util Ċ import Ġcom . tester um . test _ file _ format . step def . File Step Def Ċ import Ġcom . tester um . test _ file _ format . step def . signature . part . File Param Step Def Signature Part Ċ import Ġcom . tester um . test _ file _ format . step def . signature . part . File Step Def Signature Part Ċ import Ġcom . tester um . test _ file _ format . step def . signature . part . File Text Step Def Signature Part Ċ import Ġjava . nio . file . Path Ġas ĠJava Path Ċ Ċ class ĠFile To Business Step Mapper ( private Ġval Ġphase Mapper : ĠFile To Business Phase Mapper , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprivate Ġval Ġcalls Mapper : ĠFile To Business Step Call Mapper ) Ġ{ ĊĊĠĠĠ Ġfun Ġmap Step Def ( file Step Def : ĠFile Step Def , Ġrelative FilePath : ĠJava Path ): ĠComp osed Step Def Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpath Ġ= ĠPath . create Instance ( relative FilePath . toString ()) ĊĠĠĠĠĠĠĠ Ġval Ġphase Ġ= Ġphase Mapper . map Step Phase ( file Step Def . signature . phase ) ĊĠĠĠĠĠĠĠ Ġval Ġstep Pattern Ġ= Ġmap Signature Parts ( file Step Def . signature . parts ) ĊĊĠĠĠĠĠĠĠ Ġval Ġstep Call Id Prefix Ġ= ĠStep Hash Util . calculate Step Hash ( phase , Ġstep Pattern ) ĊĠĠĠĠĠĠĠ Ġval Ġstep Calls Ġ= Ġcalls Mapper . map Step Calls ( file Step Def . steps , Ġstep Call Id Prefix ) ĊĊĠĠĠĠĠĠĠ Ġreturn ĠComp osed Step Def ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpath Ġ= Ġpath , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġphase Ġ= Ġphase , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstep Pattern Ġ= Ġstep Pattern , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġdescription Ġ= Ġfile Step Def . description , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtags Ġ= Ġfile Step Def . tags , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstep Calls Ġ= Ġstep Calls ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġmap Signature Parts ( file Signature Parts : ĠList < File Step Def Signature Part >): ĠStep Pattern Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠStep Pattern ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpattern Parts Ġ= Ġfile Signature Parts . map Ġ{ Ġmap Signature Part ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġmap Signature Part ( file Signature Part : ĠFile Step Def Signature Part ): ĠStep Pattern Part Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġwhen Ġ( file Signature Part ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠFile Text Step Def Signature Part Ġ Ġ-> ĠText Step Pattern Part ( file Signature Part . text ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠFile Param Step Def Signature Part Ġ-> ĠParam Step Pattern Part ( file Signature Part . name , ĠType Meta Factory . getType Meta FromString ( file Signature Part . type ) Ġ?: Ġthrow ĠRuntimeException (" Unknown ĠType Meta Ġ[ ${ file Signature Part . type }] ")) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse ĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ-> Ġthrow ĠException (" unknown ĠFile Step Def Signature Part Ġ[ ${ file Signature Part . java Class . name }] ") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ Ċ } Ċ