Skip to content

Commit

Permalink
refactor: endpoints urls changed
Browse files Browse the repository at this point in the history
  • Loading branch information
SilvanoGPM committed Jan 10, 2022
1 parent 4673852 commit c484a25
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public ResponseEntity<List<ClientRequestDrinkCount>> getMyTopFiveDrinks(Principa
@ApiResponse(responseCode = "500", description = "Quando acontece um erro no servidor")
})
@SecurityRequirement(name = "bearerAuth")
public ResponseEntity<List<ClientRequestAlcoholicDrinkCount>> getTotalOfDrinksGroupeddByAlcoholic(Principal principal) {
public ResponseEntity<List<ClientRequestAlcoholicDrinkCount>> getTotalOfDrinksGroupedByAlcoholic(Principal principal) {
return ResponseEntity.ok(clientRequestService.getTotalOfDrinksGroupedByAlcoholic(authUtil.getUser(principal)));
}

Expand Down Expand Up @@ -124,7 +124,7 @@ public ResponseEntity<ClientRequest> findById(@PathVariable UUID uuid) {
return ResponseEntity.ok((clientRequestService.findByIdOrElseThrowBadRequestException(uuid)));
}

@GetMapping("/admin/all-blocked")
@GetMapping("/all/all-blocked")
@Operation(summary = "Retorna se todos os usuários estão bloqueados", tags = "Requests")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Operação foi realizada com sucesso"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class TableController {

private final TableService tableService;

@GetMapping("/waiter")
@GetMapping("/all")
@Operation(summary = "Retorna todos as mesas com paginação", tags = "Tables")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Operação foi realizada com sucesso"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.messaging.simp.SimpMessagingTemplate;
Expand Down Expand Up @@ -259,7 +258,7 @@ void countTotalDrinksInRequest_ReturnsClientRequestDrinksCount_WhenSuccessful()
void countAlcoholicDrinksInRequests_ReturnsTotalOfClientRequestsGroupedByAlcoholic_WhenSuccessful() {
Principal principalMock = Mockito.mock(Principal.class);

ResponseEntity<List<ClientRequestAlcoholicDrinkCount>> entity = clientRequestController.getTotalOfDrinksGroupeddByAlcoholic(principalMock);
ResponseEntity<List<ClientRequestAlcoholicDrinkCount>> entity = clientRequestController.getTotalOfDrinksGroupedByAlcoholic(principalMock);

assertThat(entity).isNotNull();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void listAll_ReturnListOfTablesInsidePageObject_WhenSuccessful() {
Table tableSaved = tableRepository.save(TableCreator.createTableToBeSave());

ResponseEntity<PageableResponse<Table>> entity = testRestTemplate.exchange(
"/tables/waiter",
"/tables/all",
HttpMethod.GET,
tokenUtil.createWaiterAuthEntity(null),
new ParameterizedTypeReference<>() {
Expand All @@ -71,7 +71,7 @@ void listAll_ReturnListOfTablesInsidePageObject_WhenSuccessful() {
@DisplayName("listAll return empty page when there are no tables")
void listAll_ReturnEmptyPage_WhenThereAreNoTables() {
ResponseEntity<PageableResponse<Table>> entity = testRestTemplate.exchange(
"/tables/waiter",
"/tables/all",
HttpMethod.GET,
tokenUtil.createWaiterAuthEntity(null),
new ParameterizedTypeReference<>() {
Expand All @@ -93,7 +93,7 @@ void listAll_ReturnEmptyPage_WhenThereAreNoTables() {
@DisplayName("listAll returns 403 Forbidden when user does not have ROLE_WAITER")
void listAll_Returns403Forbidden_WhenUserDoesNotHaveROLE_WAITER() {
ResponseEntity<Void> entity = testRestTemplate.exchange(
"/tables/waiter",
"/tables/all",
HttpMethod.GET,
tokenUtil.createUserAuthEntity(null),
Void.class
Expand Down

0 comments on commit c484a25

Please sign in to comment.