Skip to content

Commit

Permalink
fix sync url
Browse files Browse the repository at this point in the history
  • Loading branch information
mucsi96 committed Oct 14, 2023
1 parent a26df8b commit ad85c08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,17 @@
@Slf4j
public class StravaController {

private final StravaFintnessService stravaFintnessService;
private final StravaActivityService stravaActivityService;
private final RideService rideService;
private final OAuth2AuthorizedClientManager stravaAuthorizedClientManager;

@PostMapping("/sync")
@PostMapping("/activities/sync")
@Operation(parameters = {
@Parameter(in = ParameterIn.HEADER, name = "X-Timezone", required = true, example = "America/New_York")
}, responses = { @ApiResponse(content = @Content()),
@ApiResponse(responseCode = "401", content = @Content(), links = {
@io.swagger.v3.oas.annotations.links.Link(name = "oauth2Login", operationId = "strava-authorize") }) })
public ResponseEntity<RepresentationModel<?>> sync(
public ResponseEntity<RepresentationModel<?>> syncActivities(
Authentication principal,
HttpServletRequest servletRequest,
HttpServletResponse servletResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private void authorizeStravaOAuth2Client() {
public void returns_not_authorized_if_authorized_client_is_not_found() throws Exception {
MockHttpServletResponse response = mockMvc
.perform(
post("/strava/sync")
post("/strava/activities/sync")
.headers(getHeaders("user")))
.andReturn().getResponse();

Expand All @@ -113,7 +113,7 @@ public void returns_forbidden_if_user_has_no_user_role() throws Exception {
authorizeStravaOAuth2Client();
MockHttpServletResponse response = mockMvc
.perform(
post("/strava/sync")
post("/strava/activities/sync")
.headers(getHeaders("guest")))
.andReturn().getResponse();

Expand Down Expand Up @@ -225,7 +225,7 @@ public void requests_new_access_token_if_its_expired() throws Exception {

mockMvc
.perform(
post("/strava/sync")
post("/strava/activities/sync")
.headers(getHeaders("user")))
.andReturn().getResponse();

Expand Down Expand Up @@ -259,7 +259,7 @@ public void returns_not_authorized_if_refresh_token_is_invalid() throws Exceptio

MockHttpServletResponse response = mockMvc
.perform(
post("/strava/sync")
post("/strava/activities/sync")
.headers(getHeaders("user")))
.andReturn().getResponse();

Expand Down Expand Up @@ -296,7 +296,7 @@ public void pulls_todays_weight_from_strava_to_database() throws Exception {

MockHttpServletResponse response = mockMvc
.perform(
post("/strava/sync")
post("/strava/activities/sync")
.headers(getHeaders("user")))
.andReturn().getResponse();

Expand Down

0 comments on commit ad85c08

Please sign in to comment.