Tony CHEMIT pushed to branch develop at ultreiaio / ird-observe

Commits:

23 changed files:

Changes:

  • core/api/validation/src/main/filtered-resources/META-INF/validators/validation.json
    ... ... @@ -11820,7 +11820,8 @@
    11820 11820
           {
    
    11821 11821
             "name": "country",
    
    11822 11822
             "comments": [
    
    11823
    -          "check if referential country is disabled (only if validation is strong)"
    
    11823
    +          "check if referential country is disabled (only if validation is strong)",
    
    11824
    +          "country must be null if vessel is filled"
    
    11824 11825
             ]
    
    11825 11826
           },
    
    11826 11827
           {
    
    ... ... @@ -11944,7 +11945,8 @@
    11944 11945
           {
    
    11945 11946
             "name": "country",
    
    11946 11947
             "comments": [
    
    11947
    -          "check if referential country is disabled (only if validation is strong)"
    
    11948
    +          "check if referential country is disabled (only if validation is strong)",
    
    11949
    +          "country must be null if vessel is filled"
    
    11948 11950
             ]
    
    11949 11951
           },
    
    11950 11952
           {
    
    ... ... @@ -14990,7 +14992,8 @@
    14990 14992
           {
    
    14991 14993
             "name": "country",
    
    14992 14994
             "comments": [
    
    14993
    -          "check if referential country is disabled (only if validation is strong)"
    
    14995
    +          "check if referential country is disabled (only if validation is strong)",
    
    14996
    +          "country must be null if vessel is filled"
    
    14994 14997
             ]
    
    14995 14998
           },
    
    14996 14999
           {
    
    ... ... @@ -15114,7 +15117,8 @@
    15114 15117
           {
    
    15115 15118
             "name": "country",
    
    15116 15119
             "comments": [
    
    15117
    -          "check if referential country is disabled (only if validation is strong)"
    
    15120
    +          "check if referential country is disabled (only if validation is strong)",
    
    15121
    +          "country must be null if vessel is filled"
    
    15118 15122
             ]
    
    15119 15123
           },
    
    15120 15124
           {
    

  • core/api/validation/src/main/i18n/getters/validation-messages.getter
    ... ... @@ -58,6 +58,7 @@ observe.data.ps.Route.validation.duplicated.date
    58 58
     observe.data.ps.SampleSpecies.validation.mismatch.measuredCount
    
    59 59
     observe.data.ps.SampleSpecies.validation.mismatch.subSampleNumber
    
    60 60
     observe.data.ps.TransmittingBuoy.validation.code
    
    61
    +observe.data.ps.TransmittingBuoy.validation.country.not.required
    
    61 62
     observe.data.ps.common.Trip.departureWellContentStatus.validation.notFilled
    
    62 63
     observe.data.ps.common.Trip.departureWellContentStatus.validation.required
    
    63 64
     observe.data.ps.common.Trip.landingWellContentStatus.validation.notFilled
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/TransmittingBuoyDto-create-error-validation.xml
    ... ... @@ -62,6 +62,12 @@
    62 62
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    63 63
           <message/>
    
    64 64
         </field-validator>
    
    65
    +
    
    66
    +    <!-- country must be null if vessel is filled -->
    
    67
    +    <field-validator type="fieldexpression">
    
    68
    +      <param name="expression"><![CDATA[ country == null || vessel == null ]]></param>
    
    69
    +      <message>observe.data.ps.TransmittingBuoy.validation.country.not.required</message>
    
    70
    +    </field-validator>
    
    65 71
       </field>
    
    66 72
     
    
    67 73
       <field name="homeId">
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/logbook/TransmittingBuoyDto-update-error-validation.xml
    ... ... @@ -62,6 +62,12 @@
    62 62
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    63 63
           <message/>
    
    64 64
         </field-validator>
    
    65
    +
    
    66
    +    <!-- country must be null if vessel is filled -->
    
    67
    +    <field-validator type="fieldexpression">
    
    68
    +      <param name="expression"><![CDATA[ country == null || vessel == null ]]></param>
    
    69
    +      <message>observe.data.ps.TransmittingBuoy.validation.country.not.required</message>
    
    70
    +    </field-validator>
    
    65 71
       </field>
    
    66 72
     
    
    67 73
       <field name="homeId">
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/TransmittingBuoyDto-create-error-validation.xml
    ... ... @@ -62,6 +62,12 @@
    62 62
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    63 63
           <message/>
    
    64 64
         </field-validator>
    
    65
    +
    
    66
    +    <!-- country must be null if vessel is filled -->
    
    67
    +    <field-validator type="fieldexpression">
    
    68
    +      <param name="expression"><![CDATA[ country == null || vessel == null ]]></param>
    
    69
    +      <message>observe.data.ps.TransmittingBuoy.validation.country.not.required</message>
    
    70
    +    </field-validator>
    
    65 71
       </field>
    
    66 72
     
    
    67 73
       <field name="homeId">
    

  • core/api/validation/src/main/resources/fr/ird/observe/dto/data/ps/observation/TransmittingBuoyDto-update-error-validation.xml
    ... ... @@ -62,6 +62,12 @@
    62 62
         <field-validator type="checkDisabledReferentialOnErrorScope">
    
    63 63
           <message/>
    
    64 64
         </field-validator>
    
    65
    +
    
    66
    +    <!-- country must be null if vessel is filled -->
    
    67
    +    <field-validator type="fieldexpression">
    
    68
    +      <param name="expression"><![CDATA[ country == null || vessel == null ]]></param>
    
    69
    +      <message>observe.data.ps.TransmittingBuoy.validation.country.not.required</message>
    
    70
    +    </field-validator>
    
    65 71
       </field>
    
    66 72
     
    
    67 73
       <field name="homeId">
    

  • core/api/validation/src/main/validation/fr/ird/observe/dto/data/ps/logbook/TransmittingBuoyDto-create-error-validation.xml
    ... ... @@ -31,4 +31,11 @@
    31 31
           <message>observe.data.ps.TransmittingBuoy.validation.code##${code}##${transmittingBuoyType.regex}</message>
    
    32 32
         </field-validator>
    
    33 33
       </field>
    
    34
    +  <field name="country">
    
    35
    +    <!-- country must be null if vessel is filled -->
    
    36
    +    <field-validator type="fieldexpression">
    
    37
    +      <param name="expression"><![CDATA[ country == null || vessel == null ]]></param>
    
    38
    +      <message>observe.data.ps.TransmittingBuoy.validation.country.not.required</message>
    
    39
    +    </field-validator>
    
    40
    +  </field>
    
    34 41
     </validators>

  • core/api/validation/src/main/validation/fr/ird/observe/dto/data/ps/logbook/TransmittingBuoyDto-update-error-validation.xml
    ... ... @@ -31,4 +31,11 @@
    31 31
           <message>observe.data.ps.TransmittingBuoy.validation.code##${code}##${transmittingBuoyType.regex}</message>
    
    32 32
         </field-validator>
    
    33 33
       </field>
    
    34
    +  <field name="country">
    
    35
    +    <!-- country must be null if vessel is filled -->
    
    36
    +    <field-validator type="fieldexpression">
    
    37
    +      <param name="expression"><![CDATA[ country == null || vessel == null ]]></param>
    
    38
    +      <message>observe.data.ps.TransmittingBuoy.validation.country.not.required</message>
    
    39
    +    </field-validator>
    
    40
    +  </field>
    
    34 41
     </validators>

  • core/api/validation/src/main/validation/fr/ird/observe/dto/data/ps/observation/TransmittingBuoyDto-create-error-validation.xml
    ... ... @@ -31,4 +31,11 @@
    31 31
           <message>observe.data.ps.TransmittingBuoy.validation.code##${code}##${transmittingBuoyType.regex}</message>
    
    32 32
         </field-validator>
    
    33 33
       </field>
    
    34
    +  <field name="country">
    
    35
    +    <!-- country must be null if vessel is filled -->
    
    36
    +    <field-validator type="fieldexpression">
    
    37
    +      <param name="expression"><![CDATA[ country == null || vessel == null ]]></param>
    
    38
    +      <message>observe.data.ps.TransmittingBuoy.validation.country.not.required</message>
    
    39
    +    </field-validator>
    
    40
    +  </field>
    
    34 41
     </validators>

  • core/api/validation/src/main/validation/fr/ird/observe/dto/data/ps/observation/TransmittingBuoyDto-update-error-validation.xml
    ... ... @@ -31,4 +31,11 @@
    31 31
           <message>observe.data.ps.TransmittingBuoy.validation.code##${code}##${transmittingBuoyType.regex}</message>
    
    32 32
         </field-validator>
    
    33 33
       </field>
    
    34
    +  <field name="country">
    
    35
    +    <!-- country must be null if vessel is filled -->
    
    36
    +    <field-validator type="fieldexpression">
    
    37
    +      <param name="expression"><![CDATA[ country == null || vessel == null ]]></param>
    
    38
    +      <message>observe.data.ps.TransmittingBuoy.validation.country.not.required</message>
    
    39
    +    </field-validator>
    
    40
    +  </field>
    
    34 41
     </validators>

  • core/persistence/migration/src/main/java/fr/ird/observe/spi/migration/v9/DataSourceMigrationForVersion_9_3.java
    ... ... @@ -49,6 +49,8 @@ public class DataSourceMigrationForVersion_9_3 extends ByMajorMigrationVersionRe
    49 49
             if (withIds) {
    
    50 50
                 // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2044
    
    51 51
                 executor.addScript("01", "issue-2044");
    
    52
    +            // See https://gitlab.com/ultreiaio/ird-observe/-/issues/2821
    
    53
    +            executor.addScript("02", "issue-2821");
    
    52 54
             }
    
    53 55
         }
    
    54 56
     
    

  • core/persistence/migration/src/main/resources/db/migration/v9/9.3/02_issue-2821-common.sql
    1
    +---
    
    2
    +-- #%L
    
    3
    +-- ObServe Core :: Persistence :: Migration
    
    4
    +-- %%
    
    5
    +-- Copyright (C) 2008 - 2023 IRD, Ultreia.io
    
    6
    +-- %%
    
    7
    +-- This program is free software: you can redistribute it and/or modify
    
    8
    +-- it under the terms of the GNU General Public License as
    
    9
    +-- published by the Free Software Foundation, either version 3 of the
    
    10
    +-- License, or (at your option) any later version.
    
    11
    +--
    
    12
    +-- This program is distributed in the hope that it will be useful,
    
    13
    +-- but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    14
    +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    15
    +-- GNU General Public License for more details.
    
    16
    +--
    
    17
    +-- You should have received a copy of the GNU General Public
    
    18
    +-- License along with this program.  If not, see
    
    19
    +-- <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    20
    +-- #L%
    
    21
    +---
    
    22
    +UPDATE ps_observation.TransmittingBuoy SET country = NULL WHERE vessel IS NOT NULL;
    
    23
    +UPDATE ps_logbook.TransmittingBuoy SET country = NULL WHERE vessel IS NOT NULL;
    \ No newline at end of file

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/TransmittingBuoy/validation-create.json
    ... ... @@ -17,7 +17,8 @@
    17 17
       },
    
    18 18
       "country": {
    
    19 19
         "errors": [
    
    20
    -      "check if referential country is disabled (only if validation is strong)"
    
    20
    +      "check if referential country is disabled (only if validation is strong)",
    
    21
    +      "country must be null if vessel is filled"
    
    21 22
         ],
    
    22 23
         "warnings": [
    
    23 24
           "check if referential country is disabled (only if validation is not strong)"
    

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/logbook/TransmittingBuoy/validation-update.json
    ... ... @@ -17,7 +17,8 @@
    17 17
       },
    
    18 18
       "country": {
    
    19 19
         "errors": [
    
    20
    -      "check if referential country is disabled (only if validation is strong)"
    
    20
    +      "check if referential country is disabled (only if validation is strong)",
    
    21
    +      "country must be null if vessel is filled"
    
    21 22
         ],
    
    22 23
         "warnings": [
    
    23 24
           "check if referential country is disabled (only if validation is not strong)"
    

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/TransmittingBuoy/validation-create.json
    ... ... @@ -17,7 +17,8 @@
    17 17
       },
    
    18 18
       "country": {
    
    19 19
         "errors": [
    
    20
    -      "check if referential country is disabled (only if validation is strong)"
    
    20
    +      "check if referential country is disabled (only if validation is strong)",
    
    21
    +      "country must be null if vessel is filled"
    
    21 22
         ],
    
    22 23
         "warnings": [
    
    23 24
           "check if referential country is disabled (only if validation is not strong)"
    

  • core/persistence/resources/src/main/resources/fr/ird/observe/entities/data/ps/observation/TransmittingBuoy/validation-update.json
    ... ... @@ -17,7 +17,8 @@
    17 17
       },
    
    18 18
       "country": {
    
    19 19
         "errors": [
    
    20
    -      "check if referential country is disabled (only if validation is strong)"
    
    20
    +      "check if referential country is disabled (only if validation is strong)",
    
    21
    +      "country must be null if vessel is filled"
    
    21 22
         ],
    
    22 23
         "warnings": [
    
    23 24
           "check if referential country is disabled (only if validation is not strong)"
    

  • core/services/client/src/test/java/fr/ird/observe/services/client/service/ReportsTest.java
    1
    +package fr.ird.observe.services.client.service;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe Core :: Services :: Client
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.services.service.ReportService;
    
    26
    +import fr.ird.observe.services.service.ReportServiceFixtures;
    
    27
    +import org.junit.Test;
    
    28
    +import org.junit.runners.Parameterized;
    
    29
    +
    
    30
    +import java.util.Set;
    
    31
    +
    
    32
    +/**
    
    33
    + * Created at 11/12/2023.
    
    34
    + *
    
    35
    + * @author Tony Chemit - dev@tchemit.fr
    
    36
    + * @since 9.3.0
    
    37
    + */
    
    38
    +public class ReportsTest extends ServiceClientTestSupportRead<ReportService> {
    
    39
    +
    
    40
    +    protected static final ReportServiceFixtures fixtures = new ReportServiceFixtures();
    
    41
    +
    
    42
    +    @Parameterized.Parameter
    
    43
    +    public String reportId;
    
    44
    +
    
    45
    +    public ReportsTest() {
    
    46
    +        super(ReportService.class);
    
    47
    +    }
    
    48
    +
    
    49
    +    @Parameterized.Parameters(name = "{0}")
    
    50
    +    public static Set<String> data() {
    
    51
    +        return ReportServiceFixtures.getReports().keySet();
    
    52
    +    }
    
    53
    +
    
    54
    +    @Test
    
    55
    +    public void tesReport() {
    
    56
    +        ReportService service = getService();
    
    57
    +        fixtures.executeReport(service, reportId);
    
    58
    +    }
    
    59
    +}

  • core/services/i18n/src/main/i18n/translations/services_en_GB.properties
    ... ... @@ -932,6 +932,7 @@ observe.data.ps.Route.validation.invalid.time=Observation time can't be after th
    932 932
     observe.data.ps.SampleSpecies.validation.mismatch.measuredCount=Measure count (%s) must be the sum of frequencies count (%s)
    
    933 933
     observe.data.ps.SampleSpecies.validation.mismatch.subSampleNumber=The sub sample number must be strictly positive if the sample is a « super sample ».
    
    934 934
     observe.data.ps.TransmittingBuoy.validation.code=The buoy identifier (%s) does not respect the following regular expression «%s».
    
    935
    +observe.data.ps.TransmittingBuoy.validation.country.not.required=Country not required if vessel is filled.
    
    935 936
     observe.data.ps.common.Trip.action.move.all=Move all
    
    936 937
     observe.data.ps.common.Trip.action.move.all.choose.parent.message=Select target trip
    
    937 938
     observe.data.ps.common.Trip.action.move.all.choose.parent.title=Move data to another trip
    

  • core/services/i18n/src/main/i18n/translations/services_es_ES.properties
    ... ... @@ -932,6 +932,7 @@ observe.data.ps.Route.validation.invalid.time=La hora de la observación de la a
    932 932
     observe.data.ps.SampleSpecies.validation.mismatch.measuredCount=Measure count (%s) must be the sum of frequencies count (%s)
    
    933 933
     observe.data.ps.SampleSpecies.validation.mismatch.subSampleNumber=The sub sample number must be strictly positive if the sample is a « super sample ». \#TODO
    
    934 934
     observe.data.ps.TransmittingBuoy.validation.code=El identificador de boya ingresado (%s) no respeta la sintaxis definida por la expresión regular “%s”.
    
    935
    +observe.data.ps.TransmittingBuoy.validation.country.not.required=Country not required if vessel is filled. \#TODO
    
    935 936
     observe.data.ps.common.Trip.action.move.all=Move all
    
    936 937
     observe.data.ps.common.Trip.action.move.all.choose.parent.message=Select target trip
    
    937 938
     observe.data.ps.common.Trip.action.move.all.choose.parent.title=Move data to another trip
    

  • core/services/i18n/src/main/i18n/translations/services_fr_FR.properties
    ... ... @@ -932,6 +932,7 @@ observe.data.ps.Route.validation.invalid.time=L'heure d'observation d'une activi
    932 932
     observe.data.ps.SampleSpecies.validation.mismatch.measuredCount=Le nombre mesuré (%s) doit valoir la somme des effectifs de fréquences (%s)
    
    933 933
     observe.data.ps.SampleSpecies.validation.mismatch.subSampleNumber=Le numéro de sous-échantillon doit être strictement positif si l'échantillon est un « super échantillon ».
    
    934 934
     observe.data.ps.TransmittingBuoy.validation.code=L'identifiant de balise (%s) ne respecte pas la syntaxe définie via l'expression régulière «%s».
    
    935
    +observe.data.ps.TransmittingBuoy.validation.country.not.required=Le pavillon ne doit pas être renseigné si le navire est renseigné.
    
    935 936
     observe.data.ps.common.Trip.action.move.all=Déplacer des données
    
    936 937
     observe.data.ps.common.Trip.action.move.all.choose.parent.message=À quelle marée voulez-vous associer les données sélectionnées ?
    
    937 938
     observe.data.ps.common.Trip.action.move.all.choose.parent.title=Changer la marée des données sélectionnées
    

  • core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportServiceLocalReadTest.java
    ... ... @@ -23,103 +23,17 @@ package fr.ird.observe.services.local.service;
    23 23
      */
    
    24 24
     
    
    25 25
     import fr.ird.observe.report.Report;
    
    26
    -import fr.ird.observe.services.service.ReportService;
    
    27
    -import org.junit.Ignore;
    
    26
    +import fr.ird.observe.services.service.ReportServiceFixtures;
    
    28 27
     import org.junit.Test;
    
    29 28
     
    
    30
    -import javax.annotation.Generated;
    
    31 29
     import java.util.Map;
    
    32 30
     
    
    33
    -@Generated(value = "io.ultreia.java4all.http.maven.plugin.test.GenerateApiImplMojo", date = "Mon Nov 14 16:20:02 CET 2022")
    
    34 31
     public class ReportServiceLocalReadTest extends GeneratedReportServiceLocalReadTest {
    
    35 32
     
    
    36 33
         @Test
    
    37 34
         public void loadDefault() {
    
    38
    -        ReportService service = getService();
    
    39
    -        Map<String, Report> reports = fixtures.getReports();
    
    35
    +        Map<String, Report> reports = ReportServiceFixtures.getReports();
    
    40 36
             fixtures.assertReports(reports);
    
    41 37
         }
    
    42 38
     
    
    43
    -    //FIXME Generate a method for each report
    
    44
    -    @Ignore
    
    45
    -    @Test
    
    46
    -    public void executeReportLlLanding() {
    
    47
    -        ReportService service = getService();
    
    48
    -        fixtures.executeReport(service, "llLanding");
    
    49
    -    }
    
    50
    -    @Ignore
    
    51
    -    @Test
    
    52
    -    public void executeReportLlLogbookActivities() {
    
    53
    -        ReportService service = getService();
    
    54
    -        fixtures.executeReport(service, "llLogbookActivities");
    
    55
    -    }
    
    56
    -
    
    57
    -    @Ignore
    
    58
    -    @Test
    
    59
    -    public void executeReportLlLogbookCatches() {
    
    60
    -        ReportService service = getService();
    
    61
    -        fixtures.executeReport(service, "llLogbookCatches");
    
    62
    -    }
    
    63
    -  @Ignore
    
    64
    -    @Test
    
    65
    -    public void executeReportLlLogbookSamplesOnActivity() {
    
    66
    -        ReportService service = getService();
    
    67
    -        fixtures.executeReport(service, "llLogbookSamplesOnActivity");
    
    68
    -    }
    
    69
    -
    
    70
    -    @Test
    
    71
    -    @Ignore
    
    72
    -    public void executeReportPsObservationLengthsDistribution() {
    
    73
    -        ReportService service = getService();
    
    74
    -        fixtures.executeReport(service, "psObservationLengthsDistribution");
    
    75
    -    }
    
    76
    -
    
    77
    -    @Test
    
    78
    -    @Ignore
    
    79
    -    public void executeReportPsObservationCatchTotalCountByGroupPerSpeciesFate() {
    
    80
    -        ReportService service = getService();
    
    81
    -        fixtures.executeReport(service, "psObservationCatchTotalCountByGroupPerSpeciesFate");
    
    82
    -    }
    
    83
    -
    
    84
    -    @Test
    
    85
    -    @Ignore
    
    86
    -    public void executeReportPsObservationCatchWeightByGroupPerSpeciesFate() {
    
    87
    -        ReportService service = getService();
    
    88
    -        fixtures.executeReport(service, "psObservationCatchWeightByGroupPerSpeciesFate");
    
    89
    -    }
    
    90
    -
    
    91
    -    @Test
    
    92
    -    @Ignore
    
    93
    -    public void executeReportPsObservationCatchWeightByGroupPerReasonForDiscard() {
    
    94
    -        ReportService service = getService();
    
    95
    -        fixtures.executeReport(service, "psObservationCatchWeightByGroupPerReasonForDiscard");
    
    96
    -    }
    
    97
    -
    
    98
    -    @Test
    
    99
    -    @Ignore
    
    100
    -    public void executeReportPsObservationCatchTotalCountByGroupPerReasonForDiscard() {
    
    101
    -        ReportService service = getService();
    
    102
    -        fixtures.executeReport(service, "psObservationCatchTotalCountByGroupPerReasonForDiscard");
    
    103
    -    }
    
    104
    -
    
    105
    -    @Test
    
    106
    -    @Ignore
    
    107
    -    public void executeReportPsObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation() {
    
    108
    -        ReportService service = getService();
    
    109
    -        fixtures.executeReport(service, "psObservationCatchWeightByGroupAndSpeciesFateDiscardPerAssociation");
    
    110
    -    }
    
    111
    -
    
    112
    -    @Test
    
    113
    -    @Ignore
    
    114
    -    public void executeReportPsObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation() {
    
    115
    -        ReportService service = getService();
    
    116
    -        fixtures.executeReport(service, "psObservationCatchTotalCountByGroupAndSpeciesFateDiscardPerAssociation");
    
    117
    -    }
    
    118
    -
    
    119
    -    @Test
    
    120
    -    @Ignore
    
    121
    -    public void executeReportPsLogbookWellPlanCheck() {
    
    122
    -        ReportService service = getService();
    
    123
    -        fixtures.executeReport(service, "psLogbookWellPlanCheck");
    
    124
    -    }
    
    125 39
     }

  • core/services/local/src/test/java/fr/ird/observe/services/local/service/ReportsTest.java
    1
    +package fr.ird.observe.services.local.service;
    
    2
    +
    
    3
    +/*-
    
    4
    + * #%L
    
    5
    + * ObServe Core :: Services :: Local
    
    6
    + * %%
    
    7
    + * Copyright (C) 2008 - 2023 IRD, Ultreia.io
    
    8
    + * %%
    
    9
    + * This program is free software: you can redistribute it and/or modify
    
    10
    + * it under the terms of the GNU General Public License as
    
    11
    + * published by the Free Software Foundation, either version 3 of the
    
    12
    + * License, or (at your option) any later version.
    
    13
    + *
    
    14
    + * This program is distributed in the hope that it will be useful,
    
    15
    + * but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    16
    + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    
    17
    + * GNU General Public License for more details.
    
    18
    + *
    
    19
    + * You should have received a copy of the GNU General Public
    
    20
    + * License along with this program.  If not, see
    
    21
    + * <http://www.gnu.org/licenses/gpl-3.0.html>.
    
    22
    + * #L%
    
    23
    + */
    
    24
    +
    
    25
    +import fr.ird.observe.services.service.ReportService;
    
    26
    +import fr.ird.observe.services.service.ReportServiceFixtures;
    
    27
    +import org.junit.Test;
    
    28
    +import org.junit.runner.RunWith;
    
    29
    +import org.junit.runners.Parameterized;
    
    30
    +
    
    31
    +import java.util.Set;
    
    32
    +
    
    33
    +/**
    
    34
    + * Created at 11/12/2023.
    
    35
    + *
    
    36
    + * @author Tony Chemit - dev@tchemit.fr
    
    37
    + * @since 9.3.0
    
    38
    + */
    
    39
    +@RunWith(Parameterized.class)
    
    40
    +public class ReportsTest extends ServiceLocalTestSupportRead<ReportService> {
    
    41
    +
    
    42
    +    protected static final ReportServiceFixtures fixtures = new ReportServiceFixtures();
    
    43
    +
    
    44
    +    @Parameterized.Parameter
    
    45
    +    public String reportId;
    
    46
    +
    
    47
    +    public ReportsTest() {
    
    48
    +        super(ReportService.class);
    
    49
    +    }
    
    50
    +
    
    51
    +    @Parameterized.Parameters(name = "{0}")
    
    52
    +    public static Set<String> data() {
    
    53
    +        return ReportServiceFixtures.getReports().keySet();
    
    54
    +    }
    
    55
    +
    
    56
    +    @Test
    
    57
    +    public void tesReport() {
    
    58
    +        ReportService service = getService();
    
    59
    +        fixtures.executeReport(service, reportId);
    
    60
    +    }
    
    61
    +}

  • core/services/test/src/main/resources/fixtures/fr/ird/observe/services/service/ValidateService-dataResult-ps.json
    ... ... @@ -954,6 +954,11 @@
    954 954
                             "lastUpdateDate": "2021-02-09T09:41:09.117Z"
    
    955 955
                           },
    
    956 956
                           "messages": [
    
    957
    +                        {
    
    958
    +                          "fieldName": "country",
    
    959
    +                          "scope": "ERROR",
    
    960
    +                          "message": "Le pavillon ne doit pas être renseigné si le navire est renseigné."
    
    961
    +                        },
    
    957 962
                             {
    
    958 963
                               "fieldName": "transmittingBuoyType",
    
    959 964
                               "scope": "WARNING",
    
    ... ... @@ -4531,6 +4536,35 @@
    4531 4536
                     "topiaVersion": 8,
    
    4532 4537
                     "lastUpdateDate": "2021-03-28T20:24:25.360Z"
    
    4533 4538
                   },
    
    4539
    +              "children": [
    
    4540
    +                {
    
    4541
    +                  "datum": {
    
    4542
    +                    "text": " DCP Abandonné (sans balise, non détruit, non coulé)",
    
    4543
    +                    "type": "fr.ird.observe.dto.data.ps.logbook.FloatingObjectDto",
    
    4544
    +                    "id": "fr.ird.data.ps.logbook.FloatingObject#1616955224271#0.8748844202241",
    
    4545
    +                    "topiaVersion": 3,
    
    4546
    +                    "lastUpdateDate": "2021-03-28T20:15:12.010Z"
    
    4547
    +                  },
    
    4548
    +                  "children": [
    
    4549
    +                    {
    
    4550
    +                      "datum": {
    
    4551
    +                        "text": "Marine Instrument (ou Nautical) modèle indéterminé##Mise à l'eau##12##sd",
    
    4552
    +                        "type": "fr.ird.observe.dto.data.ps.logbook.TransmittingBuoyDto",
    
    4553
    +                        "id": "fr.ird.data.ps.logbook.TransmittingBuoy#1616955224272#0.1758599871793043",
    
    4554
    +                        "topiaVersion": 1,
    
    4555
    +                        "lastUpdateDate": "2021-03-28T20:13:44.266Z"
    
    4556
    +                      },
    
    4557
    +                      "messages": [
    
    4558
    +                        {
    
    4559
    +                          "fieldName": "country",
    
    4560
    +                          "scope": "ERROR",
    
    4561
    +                          "message": "Le pavillon ne doit pas être renseigné si le navire est renseigné."
    
    4562
    +                        }
    
    4563
    +                      ]
    
    4564
    +                    }
    
    4565
    +                  ]
    
    4566
    +                }
    
    4567
    +              ],
    
    4534 4568
                   "messages": [
    
    4535 4569
                     {
    
    4536 4570
                       "fieldName": "schoolType",