Skip to content

Commit

Permalink
[Tech] changes after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
claire2212 committed Nov 25, 2024
1 parent a6b7c83 commit 15d71b6
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 292 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ UPDATE public.regulations_cacem SET row_hash = md5(
COALESCE(duree_validite::text, '') ||
COALESCE(temporalite::text, '') ||
COALESCE(action::text, '') ||
COALESCE(objet::text, '') ||
COALESCE(type::text, '') ||
COALESCE(signataire::text, '') ||
COALESCE(date::text, '') ||
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ALTER TABLE public.regulations_cacem DROP COLUMN echelle;
ALTER TABLE public.regulations_cacem DROP COLUMN "action";
ALTER TABLE public.regulations_cacem DROP COLUMN signataire;
ALTER TABLE public.regulations_cacem DROP COLUMN objet;

UPDATE public.regulations_cacem SET row_hash = md5(
COALESCE(entity_name::text, '') ||
Expand All @@ -14,7 +15,6 @@ UPDATE public.regulations_cacem SET row_hash = md5(
COALESCE(thematique::text, '') ||
COALESCE(duree_validite::text, '') ||
COALESCE(temporalite::text, '') ||
COALESCE(objet::text, '') ||
COALESCE(type::text, '') ||
COALESCE(date::text, '') ||
COALESCE(date_fin::text, '') ||
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,39 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
@ExtendWith(SpringExtension::class)
@WebMvcTest(value = [(RegulatoryAreas::class)])
class RegulatoryAreasITests {
@Autowired private lateinit var mockMvc: MockMvc
@Autowired
private lateinit var mockMvc: MockMvc

@MockBean private lateinit var getAllRegulatoryAreas: GetAllRegulatoryAreas
@MockBean
private lateinit var getAllRegulatoryAreas: GetAllRegulatoryAreas

@MockBean private lateinit var getRegulatoryAreaById: GetRegulatoryAreaById
@MockBean
private lateinit var getRegulatoryAreaById: GetRegulatoryAreaById

val WKTreader = WKTReader()

val multipolygonString =
"MULTIPOLYGON (((-4.54877816747593 48.305559876971, -4.54997332394943 48.3059760121399, -4.54998501370013 48.3071882334181, -4.54879290083417 48.3067746138142, -4.54877816747593 48.305559876971)))"
val Polygon = WKTreader.read(multipolygonString) as MultiPolygon

val url =
"http://extranet.legicem.metier.developpement-durable.gouv.fr/zmel-roscanvel-a3474.html?id_rub=1098"

val refReg =
"Arrêté inter-préfectoral N°2020118-0003 autorisant l'occupation temporaire du domaine public maritime par une zone de mouillages et d'équipements légers au lit-dit \"Cale de Quérlen\" sur le littoral de la commune de Roscanvel"

@Test
fun `Should get all regulatory Areas`() {
// Given
val WKTreader = WKTReader()
val multipolygonString =
"MULTIPOLYGON (((-4.54877816747593 48.305559876971, -4.54997332394943 48.3059760121399, -4.54998501370013 48.3071882334181, -4.54879290083417 48.3067746138142, -4.54877816747593 48.305559876971)))"
val Polygon = WKTreader.read(multipolygonString) as MultiPolygon
val regulatoryArea =
RegulatoryAreaEntity(
id = 17,
geom = Polygon,
entity_name = "Zone au sud de la cale",
url =
"http://extranet.legicem.metier.developpement-durable.gouv.fr/zmel-roscanvel-a3474.html?id_rub=1098",
url = url,
layer_name = "ZMEL_Cale_Querlen",
facade = "NAMO",
ref_reg =
"Arrêté inter-préfectoral N°2020118-0003 autorisant l'occupation temporaire du domaine public maritime par une zone de mouillages et d'équipements légers au lit-dit \"Cale de Quérlen\" sur le littoral de la commune de Roscanvel ",
ref_reg = refReg,
edition = "2021-11-02",
editeur = "Alexis Pré",
source = "",
Expand Down Expand Up @@ -81,21 +90,15 @@ class RegulatoryAreasITests {
@Test
fun `Should get specific regulatory Area when requested by Id`() {
// Given
val WKTreader = WKTReader()
val multipolygonString =
"MULTIPOLYGON (((-4.54877816747593 48.305559876971, -4.54997332394943 48.3059760121399, -4.54998501370013 48.3071882334181, -4.54879290083417 48.3067746138142, -4.54877816747593 48.305559876971)))"
val Polygon = WKTreader.read(multipolygonString) as MultiPolygon
val regulatoryArea =
RegulatoryAreaEntity(
id = 17,
geom = Polygon,
entity_name = "Zone au sud de la cale",
url =
"http://extranet.legicem.metier.developpement-durable.gouv.fr/zmel-roscanvel-a3474.html?id_rub=1098",
url = url,
layer_name = "ZMEL_Cale_Querlen",
facade = "NAMO",
ref_reg =
"Arrêté inter-préfectoral N°2020118-0003 autorisant l'occupation temporaire du domaine public maritime par une zone de mouillages et d'équipements légers au lit-dit \"Cale de Quérlen\" sur le littoral de la commune de Roscanvel ",
ref_reg = refReg,
edition = "2021-11-02",
editeur = "Alexis Pré",
source = "",
Expand Down

0 comments on commit 15d71b6

Please sign in to comment.