// Path: core/src/main/java/edu/jhuapl/dorset/users/User.java
// public class User {
// 
//     public static String ID = "Dorset-id";
//     public static String USERNAME = "Dorset-userName";
//     public static String FIRSTNAME = "Dorset-firstName";
//     public static String LASTNAME = "Dorset-lastName";
//     public static String LOCATION = "Dorset-location";
//     public static String EMAIL = "Dorset-email";
//     public static String DOB = "Dorset-dob";
// 
//     protected Map<String, String> userInformation = new HashMap<String, String>();
// 
//     public String getId() {
//         return userInformation.get(ID);
//     }
// 
//     public void setId(String id) {
//         this.setUserInformation(ID, id);
//     }
// 
//     public String getUserName() {
//         return userInformation.get(USERNAME);
//     }
// 
//     public void setUserName(String userName) {
//         this.setUserInformation(USERNAME, userName);
//     }
// 
//     public String getFirstName() {
//         return userInformation.get(FIRSTNAME);
//     }
// 
//     public void setFirstName(String firstName) {
//         this.setUserInformation(FIRSTNAME, firstName);
//     }
// 
//     public String getLastName() {
//         return userInformation.get(LASTNAME);
//     }
// 
//     public void setLastName(String lastName) {
//         this.setUserInformation(LASTNAME, lastName);
//     }
// 
//     public String getLocation() {
//         return userInformation.get(LOCATION);
//     }
// 
//     public void setLocation(String location) {
//         this.setUserInformation(LOCATION, location);
//     }
// 
//     public String getEmail() {
//         return userInformation.get(EMAIL);
//     }
// 
//     public void setEmail(String email) {
//         this.setUserInformation(EMAIL, email);
//     }
// 
//     public String getDob() {
//         return userInformation.get(DOB);
//     }
// 
//     public void setDob(String dob) {
//         this.setUserInformation(DOB, dob);
//     }
// 
//     public void setUserInformation(String key, String value) {
//         userInformation.put(key, value);
//     }
// 
//     public String getUserInformation(String key) {
//         return userInformation.get(key);
//     }
// 
//     public Set<String> getUserInformationKeys() {
//         return userInformation.keySet();
//     }
//     
//     public void removeUserInformation(String key) {
//         userInformation.remove(key);
//     }
// }
// 
// Path: core/src/main/java/edu/jhuapl/dorset/users/UserException.java
// public class UserException extends Exception {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public UserException(String errorMessage) {
//         super(errorMessage);
//     }
// 
// }


import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import org.junit.Test;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import edu.jhuapl.dorset.users.User;
import edu.jhuapl.dorset.users.UserException;
/*
 * Copyright 2017 The Johns Hopkins University Applied Physics Laboratory LLC
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package edu.jhuapl.dorset.ldapuserservice;







public class LdapUserServiceTest {
    
    public User mockUser() {
        User user = new User();
        user.setFirstName("mock_FirstName");
        user.setLastName("mock_LastName");
        user.setUserName("mock_UserName");
        user.setEmail("mock_Email");
        user.setDob("mock_Dob");
        user.setLocation("mock_Location");
        return user;
    }
    private String[] mockUserAttributes() {
        String [] userAttributes = new String[] {"first_name", "last_name", "email"};
        return userAttributes;
    }
    
    @Test
// Path: core/src/main/java/edu/jhuapl/dorset/users/User.java
// public class User {
// 
//     public static String ID = "Dorset-id";
//     public static String USERNAME = "Dorset-userName";
//     public static String FIRSTNAME = "Dorset-firstName";
//     public static String LASTNAME = "Dorset-lastName";
//     public static String LOCATION = "Dorset-location";
//     public static String EMAIL = "Dorset-email";
//     public static String DOB = "Dorset-dob";
// 
//     protected Map<String, String> userInformation = new HashMap<String, String>();
// 
//     public String getId() {
//         return userInformation.get(ID);
//     }
// 
//     public void setId(String id) {
//         this.setUserInformation(ID, id);
//     }
// 
//     public String getUserName() {
//         return userInformation.get(USERNAME);
//     }
// 
//     public void setUserName(String userName) {
//         this.setUserInformation(USERNAME, userName);
//     }
// 
//     public String getFirstName() {
//         return userInformation.get(FIRSTNAME);
//     }
// 
//     public void setFirstName(String firstName) {
//         this.setUserInformation(FIRSTNAME, firstName);
//     }
// 
//     public String getLastName() {
//         return userInformation.get(LASTNAME);
//     }
// 
//     public void setLastName(String lastName) {
//         this.setUserInformation(LASTNAME, lastName);
//     }
// 
//     public String getLocation() {
//         return userInformation.get(LOCATION);
//     }
// 
//     public void setLocation(String location) {
//         this.setUserInformation(LOCATION, location);
//     }
// 
//     public String getEmail() {
//         return userInformation.get(EMAIL);
//     }
// 
//     public void setEmail(String email) {
//         this.setUserInformation(EMAIL, email);
//     }
// 
//     public String getDob() {
//         return userInformation.get(DOB);
//     }
// 
//     public void setDob(String dob) {
//         this.setUserInformation(DOB, dob);
//     }
// 
//     public void setUserInformation(String key, String value) {
//         userInformation.put(key, value);
//     }
// 
//     public String getUserInformation(String key) {
//         return userInformation.get(key);
//     }
// 
//     public Set<String> getUserInformationKeys() {
//         return userInformation.keySet();
//     }
//     
//     public void removeUserInformation(String key) {
//         userInformation.remove(key);
//     }
// }
// 
// Path: core/src/main/java/edu/jhuapl/dorset/users/UserException.java
// public class UserException extends Exception {
// 
//     private static final long serialVersionUID = 1L;
// 
//     public UserException(String errorMessage) {
//         super(errorMessage);
//     }
// 
// }


// Path: components/user-service/src/test/java/edu/jhuapl/dorset/ldapuserservice/LdapUserServiceTest.java
import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import org.junit.Test;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import edu.jhuapl.dorset.users.User;
import edu.jhuapl.dorset.users.UserException;

/*
 * Copyright 2017 The Johns Hopkins University Applied Physics Laboratory LLC
 * All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package edu.jhuapl.dorset.ldapuserservice;







public class LdapUserServiceTest {
    
    public User mockUser() {
        User user = new User();
        user.setFirstName("mock_FirstName");
        user.setLastName("mock_LastName");
        user.setUserName("mock_UserName");
        user.setEmail("mock_Email");
        user.setDob("mock_Dob");
        user.setLocation("mock_Location");
        return user;
    }
    private String[] mockUserAttributes() {
        String [] userAttributes = new String[] {"first_name", "last_name", "email"};
        return userAttributes;
    }
    
    @Test
    public void testGetUserSuccess() throws NamingException, UserException {