@Test public void testBasicKit() throws ReflectiveOperationException, NameNotFoundException {
		final ActivityManager am = createActivityManager(context);
		final CondomOptions option = new CondomOptions().addKit(registry -> {
			registry.registerSystemService(Context.ACTIVITY_SERVICE, (context, name) -> am);
			registry.addPermissionSpoof(WRITE_SETTINGS);
			registry.addPermissionSpoof(ACCESS_COARSE_LOCATION);
		});
		final CondomContext condom = CondomContext.wrap(new ContextWrapper(context), "KitTest", option);

		assertEquals(am, condom.getSystemService(Context.ACTIVITY_SERVICE));
		assertEquals(am, condom.getApplicationContext().getSystemService(Context.ACTIVITY_SERVICE));
		Assert.assertNotNull(condom.getSystemService(Context.NOTIFICATION_SERVICE));	// Service not registered in kit

		assertPermission(condom, WRITE_SETTINGS, true);
		assertPermission(condom.getApplicationContext(), WRITE_SETTINGS, true);
		assertPermission(condom, ACCESS_COARSE_LOCATION, true);
		assertPermission(condom.getApplicationContext(), ACCESS_COARSE_LOCATION, true);
		assertPermission(condom, WRITE_SECURE_SETTINGS, false);					// Permission not registered to spoof in kit
		assertPermission(condom.getApplicationContext(), WRITE_SECURE_SETTINGS, false);
	}
Test cases for {@link CondomKit}

Created by Oasis on 2017/7/22.
library/src/androidTest/java/com/oasisfeng/condom/CondomKitTest.java