DeviceConfigFactory { public DeviceConfig getDeviceConfig(AccessibilityNodeInfo rootNode) { String packageName = getPackageNameFromAccessibilityNode(rootNode); return new DeviceConfig(Build.MODEL, packageName, serviceVersion); }  DeviceConfig getDeviceConfig(AccessibilityNodeInfo rootNode);  }
@Test public void getDeviceConfigReturnsNonNullDeviceConfig() { Assert.assertNotNull(testSubject.getDeviceConfig(mockRootNode)); }
@Test public void deviceConfigFactoryPropertiesExist() { Whitebox.setInternalState(Build.class, "MODEL", sampleBuildModel); DeviceConfig deviceConfig = testSubject.getDeviceConfig(mockRootNode); Assert.assertNotNull(deviceConfig.deviceName); Assert.assertEquals(sampleBuildModel, deviceConfig.deviceName); Assert.assertNotNull(deviceConfig.packageName); Assert.assertNotNull(deviceConfig.serviceVersion); }