KitConfiguration { public boolean shouldExcludeUser(MParticleUser user) { return mExcludeAnonymousUsers && (user == null || !user.isLoggedIn()); } KitConfiguration(); SparseBooleanArray getEventTypeFilters(); SparseBooleanArray getEventNameFilters(); SparseBooleanArray getEventAttributeFilters(); SparseBooleanArray getScreenNameFilters(); SparseBooleanArray getScreenAttributeFilters(); static KitConfiguration createKitConfiguration(JSONObject json); KitConfiguration parseConfiguration(JSONObject json); boolean isConsentStateFilterMatch(ConsentState consentState); final Map<String, String> filterEventAttributes(MPEvent event); final Map<String, String> filterScreenAttributes(MParticle.EventType eventType, String eventName, Map<String, String> eventAttributes); final Map<String, String> filterEventAttributes(MParticle.EventType eventType, String eventName, SparseBooleanArray filter, Map<String, String> eventAttributes); static final Map<String, ?> filterAttributes(SparseBooleanArray attributeFilters, Map<String, ?> attributes); static final boolean shouldForwardAttribute(SparseBooleanArray attributeFilters, String key); boolean shouldLogScreen(String screenName); boolean passesBracketing(int userBucket); final List<CustomMapping> getCustomMappingList(); final CustomMapping getDefaultEventProjection(); final CustomMapping getDefaultCommerceCustomMapping(); final CustomMapping getDefaultScreenCustomMapping(); int getKitId(); SparseBooleanArray getUserIdentityFilters(); Map<String, String> getSettings(); boolean shouldHonorOptOut(); SparseBooleanArray getUserAttributeFilters(); SparseBooleanArray getCommerceAttributeFilters(); SparseBooleanArray getCommerceEntityFilters(); Map<Integer, SparseBooleanArray> getCommerceEntityAttributeFilters(); Map<Integer, String> getEventAttributesAddToUser(); Map<Integer, String> getEventAttributesRemoveFromUser(); Map<Integer, String> getEventAttributesSingleItemUser(); boolean isAttributeValueFilteringActive(); boolean isAvfShouldIncludeMatches(); int getAvfHashedAttribute(); int getAvfHashedValue(); int getLowBracket(); int getHighBracket(); boolean shouldExcludeUser(MParticleUser user);  }
@Test public void testExcludeUser() { KitConfiguration kitConfiguration = new KitConfiguration(); MParticleUser mockUser = Mockito.mock(MParticleUser.class); kitConfiguration.mExcludeAnonymousUsers = true; Mockito.when(mockUser.isLoggedIn()).thenReturn(false); assertFalse(mockUser.isLoggedIn()); assertTrue(kitConfiguration.shouldExcludeUser(mockUser)); kitConfiguration.mExcludeAnonymousUsers = false; assertFalse(kitConfiguration.shouldExcludeUser(mockUser)); Mockito.when(mockUser.isLoggedIn()).thenReturn(true); assertFalse(kitConfiguration.shouldExcludeUser(mockUser)); kitConfiguration.mExcludeAnonymousUsers = true; assertFalse(kitConfiguration.shouldExcludeUser(mockUser)); }