<commit_before>package gov.nih.nci.cabig.caaers.accesscontrol.aspects;

import gov.nih.nci.cabig.caaers.AbstractTestCase;
import gov.nih.nci.cabig.caaers.RoleMembership;
import gov.nih.nci.cabig.caaers.domain.User;
import gov.nih.nci.cabig.caaers.domain.UserGroupType;
import gov.nih.nci.cabig.caaers.domain.repository.UserRepository;
import gov.nih.nci.cabig.caaers.security.SecurityTestUtils;
import gov.nih.nci.cabig.caaers.web.WebTestCase;
import junit.framework.TestCase;
import org.easymock.EasyMock;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: <NAME>
 */
public class CSMUserListFilterAspectTest extends AbstractTestCase {
    CSMUserListFilterAspect csmUserListFilterAspect;
    UserRepository userRepository;
    public void setUp() throws Exception {
        csmUserListFilterAspect = new CSMUserListFilterAspect();
        userRepository = registerMockFor(UserRepository.class);
        csmUserListFilterAspect.setUserRepository(userRepository);
        SecurityTestUtils.switchToSuperuser();
    }

    public void testApplyFilter() throws Exception {
        assertSame(userRepository, csmUserListFilterAspect.getUserRepository());
        User user = new User();
        Map<UserGroupType, RoleMembership> roleMembershipMap = new HashMap<UserGroupType, RoleMembership>();
        user.setRoleMembershipMap(roleMembershipMap);
        EasyMock.expect(userRepository.getUserByLoginName("SYSTEM")).andReturn(user);
        replayMocks();
        List<String> l = new ArrayList<String>();
        l.add("x");
        csmUserListFilterAspect.applyFilter(l);
        assertTrue(l.isEmpty());
        verifyMocks();
    }
}<commit_msg>Impoving Code Coverage - Removing unwanted code AbstractPropertyReader.java<commit_after>package gov.nih.nci.cabig.caaers.accesscontrol.aspects;

import gov.nih.nci.cabig.caaers.AbstractTestCase;
import gov.nih.nci.cabig.caaers.RoleMembership;
import gov.nih.nci.cabig.caaers.domain.User;
import gov.nih.nci.cabig.caaers.domain.UserGroupType;
import gov.nih.nci.cabig.caaers.domain.repository.UserRepository;
import gov.nih.nci.cabig.caaers.security.SecurityTestUtils;
import org.easymock.EasyMock;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author: <NAME>
 */
public class CSMUserListFilterAspectTest extends AbstractTestCase {
    CSMUserListFilterAspect csmUserListFilterAspect;

    UserRepository userRepository;
    public void setUp() throws Exception {
        csmUserListFilterAspect = new CSMUserListFilterAspect();
        userRepository = registerMockFor(UserRepository.class);
        csmUserListFilterAspect.setUserRepository(userRepository);
        SecurityTestUtils.switchToSuperuser();
    }

    public void testApplyFilter() throws Exception {
        assertSame(userRepository, csmUserListFilterAspect.getUserRepository());
        User user = new User();
        Map<UserGroupType, RoleMembership> roleMembershipMap = new HashMap<UserGroupType, RoleMembership>();
        user.setRoleMembershipMap(roleMembershipMap);
        EasyMock.expect(userRepository.getUserByLoginName("SYSTEM")).andReturn(user);
        replayMocks();
        List<String> l = new ArrayList<String>();
        l.add("x");
        csmUserListFilterAspect.applyFilter(l);
        assertTrue(l.isEmpty());
        verifyMocks();
    }
}
{'fraction_non_alphanumeric': 0.10436822046320728, 'fraction_numerical': 0.0, 'mean_word_length': 4.441786283891547, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3962882', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1067, 'n_words': 160}