-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10069 from FroMage/8795
- Loading branch information
Showing
9 changed files
with
134 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
integration-tests/main/src/main/java/io/quarkus/it/rest/Commune.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package io.quarkus.it.rest; | ||
|
||
import java.util.Set; | ||
|
||
public class Commune { | ||
public String code; | ||
public String nom; | ||
public Set<String> codesPostaux; | ||
public String codeDepartement; | ||
public String codeRegion; | ||
// departement | ||
// region | ||
public Integer population; | ||
public Float surface; | ||
|
||
public Commune() { | ||
} | ||
|
||
public Commune(String nom, String code, String codeDepartement, String codeRegion, Set<String> codePostaux, | ||
int population) { | ||
this.nom = nom; | ||
this.code = code; | ||
this.codeDepartement = codeDepartement; | ||
this.codeRegion = codeRegion; | ||
this.codesPostaux = codePostaux; | ||
this.population = population; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
integration-tests/main/src/main/java/io/quarkus/it/rest/GouvFrGeoApiClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.quarkus.it.rest; | ||
|
||
import java.util.Set; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.QueryParam; | ||
|
||
@Path("gouv-geo-api") | ||
public interface GouvFrGeoApiClient { | ||
|
||
@GET | ||
@Path("/communes") | ||
public Set<Commune> getCommunes( | ||
@QueryParam("codePostal") String postalCode); | ||
} |
27 changes: 27 additions & 0 deletions
27
integration-tests/main/src/main/java/io/quarkus/it/rest/GouvFrGeoApiClientImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.quarkus.it.rest; | ||
|
||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.QueryParam; | ||
import javax.ws.rs.core.MediaType; | ||
|
||
@Produces(MediaType.APPLICATION_JSON) | ||
@Path("gouv-geo-api") | ||
public class GouvFrGeoApiClientImpl { | ||
|
||
@GET | ||
@Path("/communes") | ||
public Set<Commune> getCommunes( | ||
@QueryParam("codePostal") String postalCode) { | ||
Set<Commune> ret = new HashSet<>(); | ||
Set<String> cp = new HashSet<>(Arrays.asList("75001", "75002", "75003", "75004", "75005", "75006", "75007", "75008", | ||
"75009", "75010", "75011", "75012", "75013", "75014", "75015", "75016", "75017", "75018", "75019", "75020")); | ||
ret.add(new Commune("Paris", "75056", "75", "11", cp, 2190327)); | ||
return ret; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
integration-tests/main/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters