### Question:
UserDao extends NamedParameterJdbcDaoSupport { public PipelineUser loadUserByName(String name) { Collection<PipelineUser> items = getJdbcTemplate().query(loadUserByNameQuery, UserParameters.getUserExtractor(), name.toLowerCase()); if (CollectionUtils.isEmpty(items)) { return null; } else { return items.stream().filter(user -> user.getUserName() .equalsIgnoreCase(name)).findAny().orElse(null); } }  @Transactional(propagation = Propagation.MANDATORY) PipelineUser createUser(PipelineUser user, List<Long> roles); @Transactional(propagation = Propagation.MANDATORY) void insertUserRoles(Long userId, List<Long> authorities); Collection<PipelineUser> loadAllUsers(); Collection<PipelineUserWithStoragePath> loadAllUsersWithDataStoragePath(); PipelineUser loadUserByName(String name); List<PipelineUser> loadUsersByNames(Collection<String> userNames); Collection<PipelineUser> loadUsersByStorageId(Long storageId); PipelineUser loadUserById(Long id); Collection<PipelineUser> loadUsersByGroup(String group); @Transactional(propagation = Propagation.MANDATORY) PipelineUser updateUser(PipelineUser user); @Transactional(propagation = Propagation.MANDATORY) PipelineUser updateUserRoles(PipelineUser user, List<Long> roles); @Transactional(propagation = Propagation.MANDATORY) void deleteUser(Long id); Collection<PipelineUser> findUsers(String prefix); Collection<PipelineUser> loadUsersList(List<Long> userIds); @Transactional(propagation = Propagation.MANDATORY) void deleteUserRoles(Long id); @Transactional(propagation = Propagation.MANDATORY) void assignRoleToUsers(Long roleId, List<Long> userIds); @Transactional(propagation = Propagation.MANDATORY) void removeRoleFromUsers(Long roleId, List<Long> userIds); List<String> findGroups(String prefix); boolean isUserInGroup(String userName, String group); List<String> loadAllGroups(); @Required void setCreateUserQuery(String createUserQuery); @Required void setAddRoleToUserQuery(String addRoleToUserQuery); @Required void setLoadUserByNameQuery(String loadUserByNameQuery); @Required void setLoadUserByIdQuery(String loadUserByIdQuery); @Required void setDeleteUserRolesQuery(String deleteUserRolesQuery); @Required void setDeleteUserQuery(String deleteUserQuery); @Required void setUserSequence(String userSequence); @Required void setUpdateUserQuery(String updateUserQuery); @Required void setLoadAllUsersQuery(String loadAllUsersQuery); @Required void setFindUsersByPrefixQuery(String findUsersByPrefixQuery); @Required void setLoadUserListQuery(String loadUserListQuery); @Required void setDeleteRoleFromUserQuery(String deleteRoleFromUserQuery); @Required void setLoadUsersByGroupQuery(String loadUsersByGroupQuery); @Required void setLoadUserByGroupQuery(String loadUserByGroupQuery); @Required void setFindGroupsByPrefixQuery(String findGroupsByPrefixQuery); @Required void setLoadAllGroupsQuery(String loadAllGroupsQuery); @Required void setLoadUsersByNamesQuery(String loadUsersByNamesQuery); @Required void setLoadUsersByStorageIdQuery(final String loadUsersByStorageIdQuery); @Required void setLoadAllUsersWithDefaultDataStoragePathQuery(
            final String loadAllUsersWithDefaultDataStoragePathQuery);  }### Answer:
@Test public void testDefaultAdmin() { PipelineUser admin = userDao.loadUserByName(defaultAdmin); Assert.assertNotNull(admin); Assert.assertEquals(defaultAdmin, admin.getUserName()); Assert.assertTrue(admin.getId().equals(1L)); Assert.assertEquals(1, admin.getRoles().size()); Assert.assertTrue(isRolePresent(DefaultRoles.ROLE_ADMIN.getRole(), admin.getRoles())); Collection<Role> allRoles = roleDao.loadAllRoles(false); Assert.assertEquals(EXPECTED_DEFAULT_ROLES_NUMBER, allRoles.size()); Assert.assertTrue(isRolePresent(DefaultRoles.ROLE_ADMIN.getRole(), allRoles)); Assert.assertTrue(isRolePresent(DefaultRoles.ROLE_USER.getRole(), allRoles)); }