mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-15 04:18:20 +00:00
test(namespace): update command lookup fixtures
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
This commit is contained in:
parent
ee17c1eb43
commit
e65795d313
2 changed files with 14 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ import com.iflytek.skillhub.domain.user.UserAccount;
|
|||
import com.iflytek.skillhub.domain.user.UserAccountRepository;
|
||||
import com.iflytek.skillhub.service.NamespaceMemberCandidateService;
|
||||
import com.iflytek.skillhub.service.NamespacePortalCommandAppService;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
|
|
@ -31,6 +32,7 @@ import org.springframework.test.web.servlet.MockMvc;
|
|||
import org.springframework.test.web.servlet.request.RequestPostProcessor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
|
|
@ -80,6 +82,11 @@ class NamespaceBatchMemberControllerTest {
|
|||
@MockBean
|
||||
private UserAccountRepository userAccountRepository;
|
||||
|
||||
@BeforeEach
|
||||
void setUpNamespaceLookup() {
|
||||
given(namespaceRepository.findIdBySlug("team-a")).willReturn(Optional.of(1L));
|
||||
}
|
||||
|
||||
@Test
|
||||
void batchAddMembers_partialSuccess_returnsResultsPerRow() throws Exception {
|
||||
Namespace namespace = namespace(1L, "team-a", NamespaceStatus.ACTIVE, NamespaceType.TEAM);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.iflytek.skillhub.domain.user.UserAccount;
|
|||
import com.iflytek.skillhub.domain.user.UserAccountRepository;
|
||||
import com.iflytek.skillhub.dto.NamespaceCandidateUserResponse;
|
||||
import com.iflytek.skillhub.service.NamespaceMemberCandidateService;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||
|
|
@ -31,6 +32,7 @@ import org.springframework.test.web.servlet.request.RequestPostProcessor;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
|
|
@ -78,6 +80,11 @@ class NamespacePortalControllerTest {
|
|||
@MockBean
|
||||
private UserAccountRepository userAccountRepository;
|
||||
|
||||
@BeforeEach
|
||||
void setUpNamespaceLookup() {
|
||||
given(namespaceRepository.findIdBySlug("team-a")).willReturn(Optional.of(1L));
|
||||
}
|
||||
|
||||
@Test
|
||||
void listMyNamespaces_returnsFrozenAndArchivedNamespacesWithCurrentRole() throws Exception {
|
||||
Namespace namespace = namespace(1L, "team-a", NamespaceStatus.ARCHIVED, NamespaceType.TEAM);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue