|
|
|
@ -15,13 +15,15 @@ |
|
|
|
*/ |
|
|
|
package org.thingsboard.server.controller; |
|
|
|
|
|
|
|
import org.junit.Test; |
|
|
|
import org.thingsboard.server.common.data.security.Authority; |
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
import static org.hamcrest.Matchers.is; |
|
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; |
|
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; |
|
|
|
|
|
|
|
import org.thingsboard.server.common.data.security.Authority; |
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
public abstract class BaseAuthControllerTest extends AbstractControllerTest { |
|
|
|
|
|
|
|
@Test |
|
|
|
@ -57,6 +59,8 @@ public abstract class BaseAuthControllerTest extends AbstractControllerTest { |
|
|
|
.andExpect(jsonPath("$.authority",is(Authority.SYS_ADMIN.name()))) |
|
|
|
.andExpect(jsonPath("$.email",is(SYS_ADMIN_EMAIL))); |
|
|
|
|
|
|
|
TimeUnit.SECONDS.sleep(1); //We need to make sure that event for invalidating token was successfully processed
|
|
|
|
|
|
|
|
logout(); |
|
|
|
doGet("/api/auth/user") |
|
|
|
.andExpect(status().isUnauthorized()); |
|
|
|
|