diff --git a/cdk/resources/CellGeolocationApi.ts b/cdk/resources/CellGeolocationApi.ts index 0dcbae13..598dae1d 100644 --- a/cdk/resources/CellGeolocationApi.ts +++ b/cdk/resources/CellGeolocationApi.ts @@ -98,7 +98,7 @@ export class CellGeolocationApi extends CloudFormation.Resource { }) this.stage = new HttpApi.CfnStage(this, 'stage', { apiId: this.api.ref, - stageName: 'v1', + stageName: '2020-10-26', autoDeploy: true, }) @@ -107,7 +107,7 @@ export class CellGeolocationApi extends CloudFormation.Resource { `HttpApiLogGroup`, { removalPolicy: CloudFormation.RemovalPolicy.RETAIN, - logGroupName: `/${this.stack.stackName}/cellGeolocation/apiAccessLogs`, + logGroupName: `/${this.stack.stackName}/cell/apiAccessLogs`, retention: this.node.tryGetContext('isTest') === true ? CloudWatchLogs.RetentionDays.ONE_DAY @@ -174,7 +174,7 @@ export class CellGeolocationApi extends CloudFormation.Resource { sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/GET/__health`, }) - // GET /cellgeolocation + // GET /cell const geolocateIntegration = new HttpApi.CfnIntegration( this, @@ -190,16 +190,16 @@ export class CellGeolocationApi extends CloudFormation.Resource { const geolocateRoute = new HttpApi.CfnRoute(this, 'geolocateRoute', { apiId: this.api.ref, - routeKey: 'GET /cellgeolocation', + routeKey: 'GET /cell', target: `integrations/${geolocateIntegration.ref}`, }) getCell.addPermission('invokeByHttpApi', { principal: new IAM.ServicePrincipal('apigateway.amazonaws.com'), - sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/GET/cellgeolocation`, + sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/GET/cell`, }) - // POST /cellgeolocation + // POST /cell const geolocationIntegration = new HttpApi.CfnIntegration( this, @@ -215,13 +215,13 @@ export class CellGeolocationApi extends CloudFormation.Resource { const geolocationRoute = new HttpApi.CfnRoute(this, 'geolocationRoute', { apiId: this.api.ref, - routeKey: 'POST /cellgeolocation', + routeKey: 'POST /cell', target: `integrations/${geolocationIntegration.ref}`, }) addCell.addPermission('invokeByHttpApi', { principal: new IAM.ServicePrincipal('apigateway.amazonaws.com'), - sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/POST/cellgeolocation`, + sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/POST/cell`, }) const deployment = new HttpApi.CfnDeployment(this, 'deployment', { diff --git a/features/CellGeolocation.feature b/features/CellGeolocation.feature index 54ed0c29..f1d04967 100644 --- a/features/CellGeolocation.feature +++ b/features/CellGeolocation.feature @@ -69,14 +69,14 @@ Feature: Cell Geolocation API available and has to be calculated, therefore the API will return 409 (Conflict) Given I store "$millis()" into "ts" - When I GET /cellgeolocation?cell={cellId}&area=211&mccmnc=26201&ts={ts} + When I GET /cell?cell={cellId}&area=211&mccmnc=26201&ts={ts} Then the response status code should be 409 And the response Access-Control-Allow-Origin should be "*" Scenario: Query a cell Given I store "$millis()" into "ts" - When I GET /cellgeolocation?cell={cellId}&area=211&mccmnc=26201&ts={ts} + When I GET /cell?cell={cellId}&area=211&mccmnc=26201&ts={ts} Then the response status code should be 200 And the response Access-Control-Allow-Origin should be "*" And the response Content-Type should be "application/json" diff --git a/features/CellGeolocationPublishApi.feature b/features/CellGeolocationPublishApi.feature index 304a5cf5..db7aaef2 100644 --- a/features/CellGeolocationPublishApi.feature +++ b/features/CellGeolocationPublishApi.feature @@ -16,7 +16,7 @@ Feature: Cell Geolocation Publish API Scenario: Provide cell geolocation - When I POST to /cellgeolocation with this JSON + When I POST to /cell with this JSON """ { "cell": {cellId}, @@ -32,7 +32,7 @@ Feature: Cell Geolocation Publish API Scenario: Query a cell Given I store "$millis()" into "ts" - When I GET /cellgeolocation?cell={cellId}&area={area}&mccmnc={mccmnc}&ts={ts} + When I GET /cell?cell={cellId}&area={area}&mccmnc={mccmnc}&ts={ts} Then the response status code should be 200 And the response Access-Control-Allow-Origin should be "*" And the response Content-Type should be "application/json"