feat: add authentication and tenant context
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.linhelp.common.security;
|
||||
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class TenantContextTests {
|
||||
|
||||
@AfterEach
|
||||
void clear() {
|
||||
TenantContext.clear();
|
||||
}
|
||||
|
||||
@Test
|
||||
void storesTenantAndCommunityForCurrentRequestThread() {
|
||||
TenantContext.set(1L, 10L);
|
||||
|
||||
assertThat(TenantContext.tenantId()).isEqualTo(1L);
|
||||
assertThat(TenantContext.communityId()).isEqualTo(10L);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user