Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ jobs:
uses: skafld/github-actions/.github/workflows/diff.yaml@main
with:
config: diff-config.yaml
secrets:
CI_PAT: ${{ secrets.CI_PAT }}

docker:
needs: [diff]
Expand All @@ -22,10 +20,6 @@ jobs:
java_modules: ${{ needs.diff.outputs.java_modules }}
python_modules: ${{ needs.diff.outputs.python_modules }}
docker_modules: ${{ needs.diff.outputs.docker_modules }}
secrets:
CI_PAT: ${{ secrets.CI_PAT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

maven:
needs: [diff]
Expand All @@ -34,10 +28,6 @@ jobs:
uses: skafld/github-actions/.github/workflows/maven-check.yaml@main
with:
maven_modules: ${{ needs.diff.outputs.java_modules }}
secrets:
CI_PAT: ${{ secrets.CI_PAT }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

kubernetes:
needs: [diff]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Optional;

@Controller
Expand All @@ -24,7 +25,7 @@ public class UserController {
@ResponseBody
public UserListResponse listUsers(
@Valid final Optional<UserSearchRequest> request) {
return UserListResponse.builder().build();
return UserListResponse.builder().userList(List.of()).build();
}

@RequestMapping(
Expand All @@ -33,6 +34,6 @@ public UserListResponse listUsers(
@ResponseBody
public User createUser(
@Valid @RequestBody final UserCreateRequest request) {
return User.builder().build();
return request.toUser();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ public void shouldReturnBadRequestWhenNameContainsNumbers() throws Exception {
.andExpect(status().isBadRequest());
}

@Test
public void shouldCreateUser() throws Exception {
UserCreateRequest request = new UserCreateRequest("Foo");

mockMvc.perform(post("/api/v1/user")
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(request)))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andExpect(content().json("{\"name\":\"Foo\"}"));
}

@Test
public void shouldReturnUserListWithCorrectSearch() throws Exception {

Expand Down
Loading