Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Test Case #:284856

Test Case Name:

System: OpenLMIS

Subsystem:Requisition

Test case designed by: Piotr Żurawski

Design Date:1725.0507.2016

Short description:  Check if OpenLMIS is blocking creating more than one account with the same username.

                                                                                                                                                   

Pre – conditions:

                                                                                                                                                                                                                                                       

 

 

Step

Action

Expected system response

Comment

1

                                                                              

Create user.

Method: POST.

URL: http://localhost:8080/api/users

Body:

{
"username":"lmisUserName",
"password":"lmisPassw",
"firstName":"olmisFirstName",
"lastName":"olmisLastName"
}

                                                   

                                                                                                                                                                                                                 

2

  

 

3

  

 

4

  

 

5

   

6

  

 

7

  

 

8

                                                  

      

{
"username": "lmisUserName",
"firstName": "olmisFirstName",
"lastName": "olmisLastName",
"verified": false,
"active": false,
"_links": {
"self": {
"href": "http://localhost:8080/api/users/f4d84f0e-6d49-419f-bda8-6a7609b369c1"
},
"user": {
"href": "http://localhost:8080/api/users/f4d84f0e-6d49-419f-bda8-6a7609b369c1"
},
"roles": {
"href": "http://localhost:8080/api/users/f4d84f0e-6d49-419f-bda8-6a7609b369c1/roles"
},
"homeFacility": {
"href": "http://localhost:8080/api/users/f4d84f0e-6d49-419f-bda8-6a7609b369c1/homeFacility"
}
}
}

           

2

Try to create account with the same username(repeat step no. 1).

{
"cause": {
"cause": {
"cause": null,
"message": "ERROR: duplicate key value violates unique constraint \"uk_r43af9ap4edm43mmtq01oddj6\"\n Detail: Key (username)=(lmisUserName) already exists."
},
"message": "could not execute statement"
},
"message": "could not execute statement; SQL [n/a]; constraint [uk_r43af9ap4edm43mmtq01oddj6]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement"
}

 

 

Post – conditions: