@Test
public void testInitCTGeofenceApiIfRequired() {

    mockStatic(FileUtils.class);
    //when cleverTapApi and settings is null
    when(FileUtils.readFromFile(any(Context.class), anyString())).thenReturn("");
    when(FileUtils.getCachedFullPath(any(Context.class),
            anyString())).thenReturn("");
    boolean actualWhenSettingsAndCTApiIsNull = Utils.initCTGeofenceApiIfRequired(application);
    assertFalse("Must be false when cleverTapApi and settings is null", actualWhenSettingsAndCTApiIsNull);
    // when cleverTapApi is null and settings is not null
    when(FileUtils.readFromFile(any(Context.class),
            anyString())).thenReturn(CTGeofenceSettingsFake.getSettingsJsonString());
    boolean actualWhenSettingsNonNullAndCTApiIsNull = Utils.initCTGeofenceApiIfRequired(application);
    assertFalse("Must be false when cleverTapApi is null and settings is not null",
            actualWhenSettingsNonNullAndCTApiIsNull);
    // when cleverTapApi is not null and settings is not null
    mockStatic(CleverTapAPI.class);
    CleverTapAPI cleverTapAPI = Mockito.mock(CleverTapAPI.class);
    when(CleverTapAPI.getGlobalInstance(any(Context.class), anyString()))
            .thenReturn(cleverTapAPI);
    boolean actualWhenSettingsNonNullAndCTApiNonNull = Utils.initCTGeofenceApiIfRequired(application);
    assertTrue("Must be true when cleverTapApi is not null and settings is not null",
            actualWhenSettingsNonNullAndCTApiNonNull);
    // when cleverTapApi is not null
    WhiteboxImpl.setInternalState(ctGeofenceAPI, "cleverTapAPI", cleverTapAPI);
    boolean actualWhenCTApiNonNull = Utils.initCTGeofenceApiIfRequired(application);
    assertTrue("Must be true when cleverTapApi is not null",
            actualWhenCTApiNonNull);
}