11package edu .tamu .app .controller ;
22
3+ import static edu .tamu .weaver .response .ApiStatus .ERROR ;
34import static edu .tamu .weaver .response .ApiStatus .SUCCESS ;
45import static org .junit .Assert .assertEquals ;
56import static org .mockito .Matchers .any ;
@@ -54,7 +55,7 @@ public class UserControllerTest {
5455
5556 @ Mock
5657 private UserRepo userRepo ;
57-
58+
5859 @ Mock
5960 private SimpMessagingTemplate simpMessagingTemplate ;
6061
@@ -74,6 +75,24 @@ public void testCredentials() {
7475 assertEquals ("Unable to get user credentials" , SUCCESS , apiResponse .getMeta ().getStatus ());
7576 }
7677
78+ @ Test
79+ public void testNullCredentials () {
80+ apiResponse = userController .credentials (null );
81+ assertEquals ("Unable to get user credentials" , ERROR , apiResponse .getMeta ().getStatus ());
82+ }
83+
84+ @ Test
85+ public void testGetUser () {
86+ apiResponse = userController .getUser (testUser1 );
87+ assertEquals ("Unable to get user" , SUCCESS , apiResponse .getMeta ().getStatus ());
88+ }
89+
90+ @ Test
91+ public void testGetNullUser () {
92+ apiResponse = userController .getUser (null );
93+ assertEquals ("Unable to get user" , ERROR , apiResponse .getMeta ().getStatus ());
94+ }
95+
7796 @ Test
7897 @ SuppressWarnings ("unchecked" )
7998 public void testAllUsers () throws Exception {
0 commit comments