Question: Your very first task is to create a registration and login feature. This feature needs to allow usersto ( Read through the entire task before
Your very first task is to create a registration and login feature. This feature needs to allow usersto Read through the entire task before you start any work:
Create an account by entering username, password, first name and last name.
a The system needs to check that the following conditions are met, and reply with theappropriate output message:
Conditions
Messages
True
False
Username contains an underscore and is nomore than characters long
Usernamesuccessfullycaptured
Username is notcorrectly formatted,please ensure thatyour usernamecontains anunderscore and is nomore than characters in length
Password meets the following passwordcomplexity rules, the password must be:
At least characters long
Contain a capital letter
Contain a number
Contain a special character
Passwordsuccessfullycaptured
Password is notcorrectly formatted,please ensure thatthe passwordcontains at least characters, a capitalletter, a number anda special character.
Login to the account using the same username and password.
a The system should provide the following messages to verify the users authenticationstate:
Conditions
Messages
True
False
The entered username and password arecorrect, and the user is able to log in
Welcome it is great tosee you again.
Username orpassword incorrect,please try again
You will need to implement aLoginclass with the following methods to ensure that yourapplication meets good coding standards and that the code you write is testable.
Method Name
Method Functionality
Boolean: checkUserName
This method ensures that any username contains an underscore and is no more than
Boolean:checkPasswordComplexity
This method ensures that passwords meet the followingpassword complexity rules, the password must be:
At least eight characters long.
Contain a capital letter
Contain a number
Contain a special character
String registerUser
This method returns the necessary registration messagingindicating if:
The username is incorrectly formatted
The password does not meet the complexityrequirements.
The two above conditions have been met and the userhas been registered successfully.
Boolean loginUser
This method verifies that the login details entered matchesthe login details stored when the user registers.
String returnLoginStatus
This method returns the necessary messaging for:
A successful login
A failed login
It is good practice to never push code that has not been tested, you will need to create thefollowing unit tests to verify that your methods are executing as expected:
Test: assertEquals
Test Data and expected system responses.
Username is correctly formatted:
The username contains an underscore and is nomore than characters long
Test Data: kyl
The system returns:
Welcome it is great to see you.
Username incorrectly formatted:
Test Data: kyle!!!!!!!
The username does not contain an underscoreand is no more than characters long
The system returns:
Username is not correctly formatted, pleaseensure that your username contains anunderscore and is no more than characters inlength.
The password meets the complexityrequirements
Test Data: Ch&&sec@ke
The system returns:
Password successfully captured
The passworddoes notmeet the complexityrequirements
Test Data: password
The system returns:
Password is not correctly formatted, pleaseensure that the password contains at least characters, a capital letter, a number and aspecial character.
Test assertTrueFalse
Login Successful
The system returns:
True
Login Failed
The system returns:
False
Username correctly formatted
The system returns:
True
Username incorrectly formatted
The system returns:
False
Password meets complexity requirements
The system returns:
True
Password does not meet complexityrequirements
The system returns:
False
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
