Skip to content

Commit c84ef25

Browse files
committed
Remove unnecessary files + Add Swagger Redirect Controller + Update AirportIntegrationTest
1 parent aa6d0b5 commit c84ef25

File tree

6 files changed

+32
-123
lines changed

6 files changed

+32
-123
lines changed

.cursorignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitpod.Dockerfile

Lines changed: 0 additions & 19 deletions
This file was deleted.

.gitpod.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.couchbase.quickstart.springdata.controller;
2+
3+
import org.springframework.http.HttpStatus;
4+
import org.springframework.stereotype.Controller;
5+
import org.springframework.web.bind.annotation.GetMapping;
6+
import org.springframework.web.bind.annotation.ResponseStatus;
7+
import org.springframework.web.servlet.view.RedirectView;
8+
9+
@Controller
10+
public class SwaggerRedirectController {
11+
12+
@GetMapping(value = { "/", "/swagger-ui", "/swagger-ui/" })
13+
@ResponseStatus(HttpStatus.MOVED_PERMANENTLY)
14+
public RedirectView redirect() {
15+
return new RedirectView("/swagger-ui/index.html");
16+
}
17+
}

src/test/java/org/couchbase/quickstart/springdata/controllers/AirportIntegrationTest.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,25 @@ void tearDown() {
8383
@Test
8484
void testGetAirport() {
8585
ResponseEntity<Airport> response = restTemplate
86-
.getForEntity("/api/v1/airport/airport_1254",
86+
.getForEntity("/api/v1/airport/airport_1255",
8787
Airport.class);
8888
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
8989
Airport airport = response.getBody();
9090
assert airport != null;
91-
Airport expectedAirport = Airport.builder().id("airport_1254").type("airport")
92-
.airportName("Calais Dunkerque")
93-
.city("Calais").country("France").faa("CQF").icao("LFAC").tz("Europe/Paris")
94-
.geo(new Geo(14.0, 50.962097, 1.954764)).build();
91+
Airport expectedAirport = Airport.builder()
92+
.id("airport_1255")
93+
.type("airport")
94+
.airportName("Peronne St Quentin")
95+
.city("Peronne")
96+
.country("France")
97+
.faa(null)
98+
.icao("LFAG").tz("Europe/Paris")
99+
.geo(Geo.builder()
100+
.lat(49.868547)
101+
.lon(3.029578)
102+
.alt(295.0)
103+
.build())
104+
.build();
95105
assertThat(airport).isEqualTo(expectedAirport);
96106
}
97107

startcb.sh

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)