Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

:feature create user #155

Merged
merged 2 commits into from
Aug 22, 2023
Merged

:feature create user #155

merged 2 commits into from
Aug 22, 2023

Conversation

m1a2st
Copy link
Contributor

@m1a2st m1a2st commented Aug 21, 2023

Why need this change? / Root cause:

  • proxy server need an api to create user

Changes made:

  • add an api

Test Scope / Change impact:

  • user controller test

Issue

@m1a2st m1a2st force-pushed the feature/create-user branch from 4bc3a7c to f053ff1 Compare August 21, 2023 12:26
@ricksu978 ricksu978 linked an issue Aug 21, 2023 that may be closed by this pull request
Copy link
Collaborator

@Wally5077 Wally5077 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review done.

}

@Test
fun givenUserNotLoginAtProxyService_whenUserCreateAnUser_thenUserShouldBeCreatedFail() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto UserCreateAnUser

Comment on lines 101 to 119
.contentType(MediaType.APPLICATION_JSON)
.contentType(APPLICATION_JSON)
.content(updateUserRequest.toJson())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. inline
  2. withJson

Comment on lines 157 to 158
.contentType(APPLICATION_JSON)
.content(CreateUserRequest(email).toJson())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment on lines 173 to 175
post("/users")
.contentType(APPLICATION_JSON)
.content(CreateUserRequest(email).toJson())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Comment on lines 164 to 168
userRepository.findByEmail(email)
.also { assertThat(it).isNotNull }
.also { assertThat(it!!.nickname).isNotNull() }
.also { assertThat(it!!.identities).isNotNull() }
.also { assertThat(it!!.email).isEqualTo(email) }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

宣告一個變數測,這裡用 also 沒有優點

Comment on lines 181 to 182
userRepository.findByEmail(email)
.also { assertThat(it).isNull() }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto 宣告變數

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@Wally5077 Wally5077 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@m1a2st m1a2st merged commit c8fb465 into main Aug 22, 2023
@m1a2st m1a2st deleted the feature/create-user branch August 22, 2023 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expose POST /users API
2 participants