/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 9 ĠHe ide lp ay ĠGmbH Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* ĠĊ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* ĠĊ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġcom . he ide lp ay . android Ċ Ċ import Ġandroidx . test . runner . Android JUnit 4 Ċ import Ġcom . he ide lp ay . android . types . Customer Ċ import Ġcom . he ide lp ay . android . types . Customer Address Ċ import Ġcom . he ide lp ay . android . util . FT Base Test Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġjava . util .* Ċ import Ġjava . util . concurrent . Count DownLatch Ċ import Ġjava . util . concurrent . TimeUnit Ċ Ċ @ RunWith ( Android JUnit 4 :: class ) Ċ class ĠFT Create Customer Test Ġ: ĠFT Base Test () Ġ{ ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Create Minimal Customer () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġhe idel Pay Ġ= Ġsetup He ide lp ay () ĊĊĠĠĠĠĠĠĠ Ġval Ġcustomer Ġ= ĠCustomer . create Customer (" John ", Ġ" Do e ") ĊĊĠĠĠĠĠĠĠ Ġval Ġlock Ġ= ĠCount DownLatch ( 1 ) ĊĠĠĠĠĠĠĠ Ġvar Ġfinished Call Ġ= Ġfalse ĊĊĠĠĠĠĠĠĠ Ġhe idel Pay . create Customer ( customer ) Ġ{ Ġcustomer Id , Ġerror Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssert . assertNotNull ( customer Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssert . assertNull ( error ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġfinished Call Ġ= Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlock . count Down () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġlock . await ( 1 0 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( finished Call ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Create Customer With All Details () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġhe idel Pay Ġ= Ġsetup He ide lp ay () ĊĊĠĠĠĠĠĠĠ Ġval Ġbilling Address Ġ= ĠCustomer Address (" John ĠDoe ", Ġ" Do e ĠStreet Ġ 1 ", Ġ" VI ", Ġ" 1 0 1 0 ", Ġ" V ien na ", Ġ" AT ") ĊĠĠĠĠĠĠĠ Ġval Ġshipping Address Ġ= ĠCustomer Address (" John ĠDoe ĠHome ", Ġ" John ĠStreet Ġ 2 ", Ġ" VI ", Ġ" 1 1 9 0 ", Ġ" V ien na ", Ġ" AT ") ĊĠĠĠĠĠĠĠ Ġval Ġunique CustomerId Ġ= Ġ" test -${ Date (). time }" ĊĠĠĠĠĠĠĠ Ġval Ġcustomer Ġ= ĠCustomer . create Customer (" John ", Ġ" Do e ", Ġunique CustomerId , Ġ" mr ", Ġ" Do e 's ", Ġ" 0 1 . 0 1 . 1 9 7 0 ", Ġ" john . doe @ does . com ", Ġ" 0 1 2 3 4 5 ", Ġ" 1 2 3 4 5 6 ", Ġbilling Address , Ġshipping Address ) ĊĊĠĠĠĠĠĠĠ Ġval Ġlock Ġ= ĠCount DownLatch ( 1 ) ĊĠĠĠĠĠĠĠ Ġvar Ġfinished Call Ġ= Ġfalse ĊĊĠĠĠĠĠĠĠ Ġhe idel Pay . create Customer ( customer ) Ġ{ Ġcustomer Id , Ġerror Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssert . assertNotNull ( customer Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssert . assertNull ( error ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġfinished Call Ġ= Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlock . count Down () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġlock . await ( 1 0 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( finished Call ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Create Registered Company Customer () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġhe idel Pay Ġ= Ġsetup He ide lp ay () ĊĊĠĠĠĠĠĠĠ Ġval Ġbilling Address Ġ= ĠCustomer Address (" John ĠDoe ", Ġ" Do e ĠStreet Ġ 1 ", Ġ" VI ", Ġ" 1 0 1 0 ", Ġ" V ien na ", Ġ" AT ") ĊĠĠĠĠĠĠĠ Ġval Ġcustomer Ġ= ĠCustomer . create Registered Company Customer (" Sample ĠCompany ", Ġ" FN Ġ 1 2 3 4 5 6 ", Ġbilling Address ) ĊĊĠĠĠĠĠĠĠ Ġval Ġlock Ġ= ĠCount DownLatch ( 1 ) ĊĠĠĠĠĠĠĠ Ġvar Ġfinished Call Ġ= Ġfalse ĊĊĠĠĠĠĠĠĠ Ġhe idel Pay . create Customer ( customer ) Ġ{ Ġcustomer Id , Ġerror Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssert . assertNotNull ( customer Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssert . assertNull ( error ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġfinished Call Ġ= Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlock . count Down () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġlock . await ( 1 0 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( finished Call ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Create Non Registered Company Customer () Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġhe idel Pay Ġ= Ġsetup He ide lp ay () ĊĊĠĠĠĠĠĠĠ Ġval Ġbilling Address Ġ= ĠCustomer Address (" John ĠDoe ", Ġ" Do e ĠStreet Ġ 1 ", Ġ" VI ", Ġ" 1 0 1 0 ", Ġ" V ien na ", Ġ" AT ") ĊĠĠĠĠĠĠĠ Ġval Ġcustomer Ġ= ĠCustomer . create Non Registered Company Customer (" John ", Ġ" Do e ", Ġ" Do e ĠCompany ", Ġ" 0 1 . 0 1 . 1 9 7 0 ", Ġ" john @ doe . company . com ", Ġbilling Address , Ġ" OWNER ", Ġ" AIR PORT ") ĊĊĠĠĠĠĠĠĠ Ġval Ġlock Ġ= ĠCount DownLatch ( 1 ) ĊĠĠĠĠĠĠĠ Ġvar Ġfinished Call Ġ= Ġfalse ĊĊĠĠĠĠĠĠĠ Ġhe idel Pay . create Customer ( customer ) Ġ{ Ġcustomer Id , Ġerror Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssert . assertNotNull ( customer Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssert . assertNull ( error ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġfinished Call Ġ= Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlock . count Down () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġlock . await ( 1 0 , ĠTimeUnit . SECONDS ) ĊĠĠĠĠĠĠĠ ĠAssert . assertTrue ( finished Call ) ĊĠĠĠ Ġ} Ċ Ċ } Ċ