|
@ -1,5 +1,6 @@ |
|
|
package de.fd.fh; |
|
|
package de.fd.fh; |
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
import de.fd.fh.server.ApiTestUtils; |
|
|
import de.fd.fh.server.ApiTestUtils; |
|
|
import de.fd.fh.server.access.web.AccessController; |
|
|
import de.fd.fh.server.access.web.AccessController; |
|
|
import de.fd.fh.server.user.web.UserController; |
|
|
import de.fd.fh.server.user.web.UserController; |
|
@ -69,4 +70,19 @@ class ServerAppTest |
|
|
assertEquals(200, res.getStatus()); |
|
|
assertEquals(200, res.getStatus()); |
|
|
then(accessController).should().registrate(any(), any()); |
|
|
then(accessController).should().registrate(any(), any()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
void testLogin() throws JsonProcessingException |
|
|
|
|
|
{ |
|
|
|
|
|
when(accessController.login(any(), any())).thenReturn("Test"); |
|
|
|
|
|
|
|
|
|
|
|
String url = "/accounts/login"; |
|
|
|
|
|
|
|
|
|
|
|
ApiTestUtils.TestResponse<String> res = new ApiTestUtils<String>() |
|
|
|
|
|
.request("POST", url, null, null, String.class); |
|
|
|
|
|
|
|
|
|
|
|
assertNotNull(res); |
|
|
|
|
|
assertEquals(200, res.getStatus()); |
|
|
|
|
|
then(accessController).should().login(any(), any()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |