• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

torresj / community-api / 2

23 May 2025 01:56PM UTC coverage: 22.105%. First build
2

push

circleci

Jaime Torres Benavente
Project ready to be deployed

42 of 173 new or added lines in 18 files covered. (24.28%)

42 of 190 relevant lines covered (22.11%)

0.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/torresj/community/controllers/UserController.java
1
package com.torresj.community.controllers;
2

3
import com.torresj.community.dtos.UserDto;
4
import com.torresj.community.exceptions.CommunityNotFoundException;
5
import com.torresj.community.services.UserService;
6
import io.swagger.v3.oas.annotations.Operation;
7
import io.swagger.v3.oas.annotations.media.ArraySchema;
8
import io.swagger.v3.oas.annotations.media.Content;
9
import io.swagger.v3.oas.annotations.media.Schema;
10
import io.swagger.v3.oas.annotations.responses.ApiResponse;
11
import io.swagger.v3.oas.annotations.responses.ApiResponses;
12
import lombok.RequiredArgsConstructor;
13
import lombok.extern.slf4j.Slf4j;
14
import org.springframework.http.ResponseEntity;
15
import org.springframework.web.bind.annotation.GetMapping;
16
import org.springframework.web.bind.annotation.RequestMapping;
17
import org.springframework.web.bind.annotation.RestController;
18

19
import java.util.List;
20

21
@RestController
22
@RequestMapping("/v1/users")
NEW
23
@Slf4j
×
24
@RequiredArgsConstructor
25
public class UserController {
26

27
    private final UserService userService;
28

29
    @Operation(summary = "Get users")
30
    @ApiResponses(
31
            value = {
32
                    @ApiResponse(
33
                            responseCode = "200",
34
                            description = "Success",
35
                            content = {
36
                                    @Content(
37
                                            mediaType = "application/json",
38
                                            array = @ArraySchema(schema = @Schema(implementation = UserDto.class)))
39
                            }),
40
            })
41
    @GetMapping()
42
    public ResponseEntity<List<UserDto>> get() throws CommunityNotFoundException {
NEW
43
        log.info("Getting Users");
×
NEW
44
        List<UserDto> users = userService.get();
×
NEW
45
        log.info("Users found: {}", users.size());
×
NEW
46
        return ResponseEntity.ok(users);
×
47
    }
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc