-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sdk): added status and role for user list (#251)
- Loading branch information
1 parent
189f7a1
commit 4370de7
Showing
7 changed files
with
117 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
import com.fasterxml.jackson.core.type.TypeReference; | ||
import java.util.*; | ||
import java.util.function.Consumer; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.junit.jupiter.api.*; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.mock.mockito.SpyBean; | ||
|
@@ -31,6 +32,7 @@ | |
import org.springframework.test.context.ContextConfiguration; | ||
import org.springframework.test.web.reactive.server.WebTestClient; | ||
|
||
@Slf4j | ||
@ActiveProfiles("test-login-enabled") | ||
@MockIntegrationTest | ||
@ContextConfiguration(classes = {TestApplication.class}) | ||
|
@@ -429,6 +431,25 @@ void givenUserCreated_whenSearch_thenReturnOk() { | |
assertThat(bodyStr, hasJsonPath("$.data.data", hasSize(greaterThanOrEqualTo(1)))); | ||
assertThat(bodyStr, hasJsonPath("$.data.data[0].email", equalTo("[email protected]"))); | ||
}); | ||
|
||
// search by role and state | ||
testClientHelper.requestAndVerify( | ||
HttpMethod.GET, | ||
(uriBuilder -> | ||
uriBuilder | ||
.path("/users") | ||
.queryParam("role", "USER") | ||
.queryParam("state", "ENABLED") | ||
.build()), | ||
headers, | ||
null, | ||
HttpStatus.OK.value(), | ||
bodyStr -> { | ||
log.info("bodyStr:{}", bodyStr); | ||
Assertions.assertNotNull(bodyStr); | ||
assertThat(bodyStr, hasJsonPath("$.data.data", notNullValue())); | ||
assertThat(bodyStr, hasJsonPath("$.data.data", hasSize(greaterThanOrEqualTo(3)))); | ||
}); | ||
} | ||
|
||
@Test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters