### Question:
GodEyeConfig implements Serializable { public static GodEyeConfig fromAssets(String assetsPath) { InputStream is = null; try { is = GodEye.instance().getApplication().getAssets().open(assetsPath); return fromInputStream(is); } catch (Exception e) { L.e(e); return GodEyeConfig.noneConfig(); } finally { IoUtil.closeSilently(is); } } private  GodEyeConfig(); static GodEyeConfigBuilder noneConfigBuilder(); static GodEyeConfig noneConfig(); static GodEyeConfigBuilder defaultConfigBuilder(); static GodEyeConfig defaultConfig(); static GodEyeConfig fromInputStream(InputStream is); static GodEyeConfig fromAssets(String assetsPath); CpuConfig getCpuConfig(); void setCpuConfig(CpuConfig cpuConfig); BatteryConfig getBatteryConfig(); void setBatteryConfig(BatteryConfig batteryConfig); FpsConfig getFpsConfig(); void setFpsConfig(FpsConfig fpsConfig); LeakConfig getLeakConfig(); void setLeakConfig(LeakConfig leakConfig); HeapConfig getHeapConfig(); void setHeapConfig(HeapConfig heapConfig); PssConfig getPssConfig(); void setPssConfig(PssConfig pssConfig); RamConfig getRamConfig(); void setRamConfig(RamConfig ramConfig); NetworkConfig getNetworkConfig(); void setNetworkConfig(NetworkConfig networkConfig); SmConfig getSmConfig(); void setSmConfig(SmConfig smConfig); StartupConfig getStartupConfig(); void setStartupConfig(StartupConfig startupConfig); TrafficConfig getTrafficConfig(); void setTrafficConfig(TrafficConfig trafficConfig); CrashConfig getCrashConfig(); void setCrashConfig(CrashConfig crashConfig); ThreadConfig getThreadConfig(); void setThreadConfig(ThreadConfig threadConfig); PageloadConfig getPageloadConfig(); void setPageloadConfig(PageloadConfig pageloadConfig); MethodCanaryConfig getMethodCanaryConfig(); void setMethodCanaryConfig(MethodCanaryConfig methodCanaryConfig); AppSizeConfig getAppSizeConfig(); void setAppSizeConfig(AppSizeConfig appSizeConfig); ViewCanaryConfig getViewCanaryConfig(); void setViewCanaryConfig(ViewCanaryConfig viewCanaryConfig); ImageCanaryConfig getImageCanaryConfig(); void setImageCanaryConfig(ImageCanaryConfig imageCanaryConfig); @Override String toString();  }### Answer:
@Test public void fromAssets() { Application originApplication = ApplicationProvider.getApplicationContext(); Application application = Mockito.spy(originApplication); Application godeyeApplication = GodEye.instance().getApplication(); GodEye.instance().internalInit(application); AssetManager assetManager = Mockito.spy(application.getAssets()); Mockito.doReturn(assetManager).when(application).getAssets(); try { Mockito.doAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); Object object = this.getClass().getClassLoader().getResourceAsStream(String.valueOf(args[0])); return object; } }).when(assetManager).open(Mockito.anyString()); } catch (IOException e) { fail(); } GodEyeConfig config = GodEyeConfig.fromAssets("install.config"); assertConfig(config); GodEye.instance().internalInit(godeyeApplication); }