diff --git a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/FleetSegmentController.kt b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/FleetSegmentController.kt index 49c227efdc..d0a35b6245 100644 --- a/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/FleetSegmentController.kt +++ b/backend/src/main/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/FleetSegmentController.kt @@ -90,7 +90,7 @@ class FleetSegmentController( } @ResponseStatus(HttpStatus.CREATED) - @PostMapping("/{year}") + @PostMapping("/backoffice/{year}") @Operation(summary = "Add a fleet segment year") fun addFleetSegmentYear( @PathParam("Year") diff --git a/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/FleetSegmentControllerITests.kt b/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/FleetSegmentControllerITests.kt index 83159d3a04..0aaeaf2e6f 100644 --- a/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/FleetSegmentControllerITests.kt +++ b/backend/src/test/kotlin/fr/gouv/cnsp/monitorfish/infrastructure/api/bff/FleetSegmentControllerITests.kt @@ -92,7 +92,7 @@ class FleetSegmentControllerITests { // When api.perform( - put("/bff/v1/fleet_segments?year=2021&segment=A_SEGMENT/WITH/SLASH") + put("/bff/v1/fleet_segments/backoffice?year=2021&segment=A_SEGMENT/WITH/SLASH") .content( objectMapper.writeValueAsString(CreateOrUpdateFleetSegmentDataInput(gears = listOf("OTB", "OTC"))), ) @@ -113,7 +113,7 @@ class FleetSegmentControllerITests { @Test fun `Should return Ok When a delete of a fleet segment is done`() { // When - api.perform(delete("/bff/v1/fleet_segments?year=2021&segment=A_SEGMENT/WITH/SLASH")) + api.perform(delete("/bff/v1/fleet_segments/backoffice?year=2021&segment=A_SEGMENT/WITH/SLASH")) // Then .andExpect(status().isOk) } @@ -121,7 +121,7 @@ class FleetSegmentControllerITests { @Test fun `Should return Ok When a new year is created`() { // When - api.perform(post("/bff/v1/fleet_segments/2023")) + api.perform(post("/bff/v1/fleet_segments/backoffice/2023")) // Then .andExpect(status().isCreated) } @@ -136,7 +136,7 @@ class FleetSegmentControllerITests { // When api.perform( - post("/bff/v1/fleet_segments") + post("/bff/v1/fleet_segments/backoffice") .content( objectMapper.writeValueAsString( CreateOrUpdateFleetSegmentDataInput( @@ -164,7 +164,7 @@ class FleetSegmentControllerITests { // When api.perform( - post("/bff/v1/fleet_segments") + post("/bff/v1/fleet_segments/backoffice") .content( objectMapper.writeValueAsString( CreateOrUpdateFleetSegmentDataInput(segment = "SEGMENT", gears = listOf("OTB", "OTC")), diff --git a/frontend/cypress/e2e/backoffice/fleet_segments.spec.ts b/frontend/cypress/e2e/backoffice/fleet_segments.spec.ts index aaadabbea6..aa396bf092 100644 --- a/frontend/cypress/e2e/backoffice/fleet_segments.spec.ts +++ b/frontend/cypress/e2e/backoffice/fleet_segments.spec.ts @@ -8,7 +8,7 @@ dayjs.extend(utc) const currentYear = dayjs().utc().year() context('Fleet segments', () => { beforeEach(() => { - cy.intercept('GET', `/bff/v1/fleet_segments/${currentYear}`).as('fleetSegments') + cy.intercept('GET', `/bff/v1/fleet_segments/backoffice/${currentYear}`).as('fleetSegments') cy.visit('/backoffice/fleet_segments') cy.wait('@fleetSegments') cy.wait(1000) @@ -35,7 +35,7 @@ context('Fleet segments', () => { cy.log('Should update the segment') // When - cy.intercept('PUT', `/bff/v1/fleet_segments?year=${currentYear}&segment=ATL01`).as('updateFleetSegment') + cy.intercept('PUT', `/bff/v1/fleet_segments/backoffice?year=${currentYear}&segment=ATL01`).as('updateFleetSegment') cy.get('[aria-rowindex="2"]').find('[title="Editer la ligne"]').click() cy.fill('Nom', 'ATL036') @@ -92,7 +92,7 @@ context('Fleet segments', () => { it('Should create a new fleet segment and delete it', () => { // Given - cy.intercept('POST', '/bff/v1/fleet_segments').as('createFleetSegment') + cy.intercept('POST', '/bff/v1/fleet_segments/backoffice').as('createFleetSegment') // When cy.clickButton('Ajouter un segment') @@ -137,7 +137,9 @@ context('Fleet segments', () => { // ------------------------------------------------------------------------- cy.log('Should delete a fleet segment') - cy.intercept('DELETE', `/bff/v1/fleet_segments?year=${currentYear}&segment=ABC123`).as('deleteFleetSegment') + cy.intercept('DELETE', `/bff/v1/fleet_segments/backoffice?year=${currentYear}&segment=ABC123`).as( + 'deleteFleetSegment' + ) cy.get('[aria-rowindex="2"]').find('[title="Supprimer la ligne"]').click() cy.wait('@deleteFleetSegment') diff --git a/frontend/src/env.d.ts b/frontend/src/env.d.ts index 848c3c4cd6..e0033d32d4 100644 --- a/frontend/src/env.d.ts +++ b/frontend/src/env.d.ts @@ -12,8 +12,8 @@ interface ImportMetaEnv { readonly FRONTEND_OIDC_AUTHORITY: string readonly FRONTEND_OIDC_CLIENT_ID: string readonly FRONTEND_OIDC_ENABLED: string - readonly FRONTEND_OIDC_REDIRECT_URI: string readonly FRONTEND_OIDC_LOGOUT_REDIRECT_URI: string + readonly FRONTEND_OIDC_REDIRECT_URI: string readonly FRONTEND_PRIOR_NOTIFICATION_LIST_ENABLED: string readonly FRONTEND_SENTRY_DSN?: string readonly FRONTEND_SENTRY_ENV?: string