/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 2 1 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* Ġ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 . android . build . api . variant . impl Ċ Ċ import Ġcom . android . build . api . component . Component Identity Ċ import Ġcom . android . build . api . variant . Variant Builder Ċ import Ġcom . android . build . gradle . internal . core . Variant Dsl Info Ċ import Ġcom . android . build . gradle . internal . services . Project Services Ċ import Ġcom . android . build . gradle . internal . services . Variant Api Services Ċ import Ġcom . android . builder . model . ApiVersion Ċ import Ġcom . android . sdk lib . Android Version Ċ import Ġcom . google . common . truth . Truth Ċ import Ġcom . google . wire less . android . sdk . stats . Gradle Build Variant Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . mockito . Mock Ċ import Ġorg . mockito . Mockito Ċ import Ġorg . mockito . junit . Mockito JUnit Ċ import Ġorg . mockito . junit . Mockito Rule Ċ import Ġorg . mockito . quality . Strict ness Ċ Ċ internal Ġclass ĠVariant Builder Impl Test Ġ{ ĊĊĠĠĠ Ġ@ get : Rule ĊĠĠĠ Ġval Ġrule : ĠMockito Rule Ġ= ĠMockito JUnit . rule (). strict ness ( Strict ness . STRICT _ ST UB S ) ĊĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġvariant Dsl Info : ĠVariant Dsl Info < *> ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġcomponent Identity : ĠComponent Identity ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġvariant Api Services : ĠVariant Api Services ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġmin Sdk Version : ĠAndroid Version ĊĠĠĠ Ġ@ Mock ĊĠĠĠ Ġlateinit Ġvar Ġtarget Sdk Version : ĠApi Version ĊĊĠĠĠ Ġval Ġbuilder Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ Ġobject Ġ: ĠVariant Builder Impl ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġvariant Dsl Info , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcomponent Identity , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġvariant Api Services ĊĠĠĠĠĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġ< T Ġ: ĠVariant Builder > Ġcreate User Visible Variant Object ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġproject Services : ĠProject Services , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġstats : ĠGradle Build Variant . Builder ? ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ): ĠT Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠRuntimeException (" Unexpected Ġmethod Ġinvocation ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun Ġsetup () Ġ{ ĊĠĠĠĠĠĠĠ ĠMockito .` when `( variant Dsl Info . min Sdk Version ). thenReturn ( min Sdk Version ) ĊĠĠĠĠĠĠĠ ĠMockito .` when `( min Sdk Version . api Level ). thenReturn ( 1 2 ) ĊĠĠĠĠĠĠĠ ĠMockito .` when `( min Sdk Version . cod ename ). thenReturn ( null ) ĊĊĠĠĠĠĠĠĠ ĠMockito .` when `( variant Dsl Info . target Sdk Version ). thenReturn ( target Sdk Version ) ĊĠĠĠĠĠĠĠ ĠMockito .` when `( target Sdk Version . api Level ). thenReturn ( 1 2 ) ĊĠĠĠĠĠĠĠ ĠMockito .` when `( target Sdk Version . cod ename ). thenReturn ( null ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Min Sdk Set ters () Ġ{ ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk ). isEqualTo ( 1 2 ) ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk Preview ). isNull () ĊĊĠĠĠĠĠĠĠ Ġbuilder . min Sdk Ġ= Ġ 4 3 ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk ). isEqualTo ( 4 3 ) ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk Preview ). isNull () ĊĊĠĠĠĠĠĠĠ Ġbuilder . min Sdk Preview Ġ= Ġ" M " ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk ). isNull () ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk Preview ). isEqualTo (" M ") ĊĊĠĠĠĠĠĠĠ Ġbuilder . min Sdk Preview Ġ= Ġ" N " ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk ). isNull () ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk Preview ). isEqualTo (" N ") ĊĊĠĠĠĠĠĠĠ Ġbuilder . min Sdk Ġ= Ġ 2 3 ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk ). isEqualTo ( 2 3 ) ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . min Sdk Preview ). isNull () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Target Sdk Set ters () Ġ{ ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk ). isEqualTo ( 1 2 ) ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk Preview ). isNull () ĊĊĠĠĠĠĠĠĠ Ġbuilder . target Sdk Ġ= Ġ 4 3 ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk ). isEqualTo ( 4 3 ) ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk Preview ). isNull () ĊĊĠĠĠĠĠĠĠ Ġbuilder . target Sdk Preview Ġ= Ġ" M " ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk ). isNull () ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk Preview ). isEqualTo (" M ") ĊĊĠĠĠĠĠĠĠ Ġbuilder . target Sdk Preview Ġ= Ġ" N " ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk ). isNull () ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk Preview ). isEqualTo (" N ") ĊĊĠĠĠĠĠĠĠ Ġbuilder . target Sdk Ġ= Ġ 2 3 ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk ). isEqualTo ( 2 3 ) ĊĠĠĠĠĠĠĠ ĠTr uth . assertThat ( builder . target Sdk Preview ). isNull () ĊĠĠĠ Ġ} Ċ } Ċ