Skip to content

Commit

Permalink
fix: remove some sonar issues (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelDemey authored Dec 3, 2024
1 parent 212dadd commit b5ffed3
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static org.mockito.ArgumentMatchers.eq;

@SpringBootTest(properties = { "fr.insee.rmes.bauhaus.lg1=fr", "fr.insee.rmes.bauhaus.lg2=en"})
public class DatasetQueriesTest {
class DatasetQueriesTest {

@Autowired
Config config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static org.mockito.ArgumentMatchers.eq;

@SpringBootTest(properties = { "fr.insee.rmes.bauhaus.lg1=fr", "fr.insee.rmes.bauhaus.lg2=en"})
public class DistributionQueriesTest {
class DistributionQueriesTest {
@Autowired
Config config;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class OperationsDocumentationsImplTest {
private OperationsDocumentationsImpl metadataReportService;

@Test
public void testExportMetadataReport_Success() throws RmesException {
void testExportMetadataReport_Success() throws RmesException {
String id = "1234";
boolean includeEmptyMas = true;
boolean lg1 = true;
Expand All @@ -45,7 +45,7 @@ public void testExportMetadataReport_Success() throws RmesException {
}

@Test
public void testExportMetadataReport_Failure_NoLanguageSelected() {
void testExportMetadataReport_Failure_NoLanguageSelected() {
String id = "1234";
boolean includeEmptyMas = true;
boolean lg1 = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class DocumentationExportTest {
private DocumentsUtils documentsUtils;

@Test
public void testExportAsZip_success() throws Exception {
void testExportAsZip_success() throws Exception {
JSONObject document = new JSONObject();
document.put("url", "file://doc.doc");
document.put("id", "1");
Expand Down Expand Up @@ -98,7 +98,7 @@ public void testExportAsZip_success() throws Exception {
}

@Test
public void testExportMetadataReport_Success_WithoutDocuments_Label() throws RmesException {
void testExportMetadataReport_Success_WithoutDocuments_Label() throws RmesException {
DocumentationExport documentationExport = new DocumentationExport(50, documentsUtils, exportUtils, seriesUtils, operationsUtils, indicatorsUtils, parentUtils, codeListService, organizationsService, documentationsUtils );

String id = "1234";
Expand All @@ -121,7 +121,7 @@ public void testExportMetadataReport_Success_WithoutDocuments_Label() throws Rm
}

@Test
public void testExportMetadataReport_Failure_UnknownGoal() throws RmesException {
void testExportMetadataReport_Failure_UnknownGoal() throws RmesException {
DocumentationExport documentationExport = new DocumentationExport(50, documentsUtils, exportUtils, seriesUtils, operationsUtils, indicatorsUtils, parentUtils, codeListService, organizationsService, documentationsUtils );

String id = "1234";
Expand All @@ -142,7 +142,7 @@ public void testExportMetadataReport_Failure_UnknownGoal() throws RmesException
}

@Test
public void testExportXmlFiles_Success() throws RmesException {
void testExportXmlFiles_Success() throws RmesException {
DocumentationExport documentationExport = new DocumentationExport(50, documentsUtils, exportUtils, seriesUtils, operationsUtils, indicatorsUtils, parentUtils, codeListService, organizationsService, documentationsUtils );

Map<String, String> xmlContent = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@SpringBootTest(properties = "spring.config.additional-location=classpath:rbac.yml")
@EnableConfigurationProperties(RBACConfiguration.class)
public class RBACConfigurationTest {
class RBACConfigurationTest {

@Autowired
private RBACConfiguration rbacConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class TestMetadataReportResourcesAuthorizationsEnvProd {
private final String timbre = "XX59-YYY";

@Test
public void testGetMSDJson() throws Exception {
void testGetMSDJson() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

String jsonResponse = "{\"key\":\"value\"}";
Expand All @@ -92,7 +92,7 @@ public void testGetMSDJson() throws Exception {
}

@Test
public void testGetMSDXml() throws Exception {
void testGetMSDXml() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

MSD msd = new MSD();
Expand All @@ -112,7 +112,7 @@ public void testGetMSDXml() throws Exception {
}

@Test
public void testGetMSDJsonRmesException() throws Exception {
void testGetMSDJsonRmesException() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

when(documentationsService.getMSDJson()).thenThrow(new RmesException(HttpStatus.INTERNAL_SERVER_ERROR, "Error", "Detailed error message"));
Expand All @@ -124,7 +124,7 @@ public void testGetMSDJsonRmesException() throws Exception {
}

@Test
public void testGetMSDXmlRmesException() throws Exception {
void testGetMSDXmlRmesException() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

when(documentationsService.getMSD()).thenThrow(new RmesException(HttpStatus.INTERNAL_SERVER_ERROR, "Error", "Detailed error message"));
Expand All @@ -137,7 +137,7 @@ public void testGetMSDXmlRmesException() throws Exception {


@Test
public void testGetMetadataAttribute() throws Exception {
void testGetMetadataAttribute() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

String id = "testId";
Expand All @@ -154,7 +154,7 @@ public void testGetMetadataAttribute() throws Exception {
}

@Test
public void testGetMetadataAttributeRmesException() throws Exception {
void testGetMetadataAttributeRmesException() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

String id = "testId";
Expand All @@ -168,7 +168,7 @@ public void testGetMetadataAttributeRmesException() throws Exception {
}

@Test
public void testGetMetadataAttributes() throws Exception {
void testGetMetadataAttributes() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

String jsonResponse = "{\"key\":\"value\"}";
Expand All @@ -184,7 +184,7 @@ public void testGetMetadataAttributes() throws Exception {
}

@Test
public void testGetMetadataAttributesRmesException() throws Exception {
void testGetMetadataAttributesRmesException() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

when(documentationsService.getMetadataAttributes()).thenThrow(new RmesException(HttpStatus.INTERNAL_SERVER_ERROR, "Error", "Detailed error message"));
Expand All @@ -196,7 +196,7 @@ public void testGetMetadataAttributesRmesException() throws Exception {
}

@Test
public void testGetMetadataReport() throws Exception {
void testGetMetadataReport() throws Exception {
String id = "1234";
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

Expand All @@ -213,7 +213,7 @@ public void testGetMetadataReport() throws Exception {
}

@Test
public void testGetMetadataReportRmesException() throws Exception {
void testGetMetadataReportRmesException() throws Exception {
String id = "1234";
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

Expand All @@ -225,7 +225,7 @@ public void testGetMetadataReportRmesException() throws Exception {
.andExpect(status().isInternalServerError());
}
@Test
public void testGetMetadataReportDefaultValue() throws Exception {
void testGetMetadataReportDefaultValue() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

String jsonResponse = "{\"key\":\"value\"}";
Expand All @@ -241,7 +241,7 @@ public void testGetMetadataReportDefaultValue() throws Exception {
}

@Test
public void testGetFullSimsJson() throws Exception {
void testGetFullSimsJson() throws Exception {
String id = "1234";
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

Expand All @@ -258,7 +258,7 @@ public void testGetFullSimsJson() throws Exception {
}

@Test
public void testGetFullSimsXml() throws Exception {
void testGetFullSimsXml() throws Exception {
String id = "1234";
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

Expand All @@ -279,7 +279,7 @@ public void testGetFullSimsXml() throws Exception {
}

@Test
public void testGetFullSimsJsonRmesException() throws Exception {
void testGetFullSimsJsonRmesException() throws Exception {
String id = "1234";
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

Expand All @@ -292,7 +292,7 @@ public void testGetFullSimsJsonRmesException() throws Exception {
}

@Test
public void testGetFullSimsXmlRmesException() throws Exception {
void testGetFullSimsXmlRmesException() throws Exception {
String id = "1234";
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

Expand All @@ -305,7 +305,7 @@ public void testGetFullSimsXmlRmesException() throws Exception {
}

@Test
public void testGetSimsExport() throws Exception {
void testGetSimsExport() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

String id = "1234";
Expand All @@ -331,7 +331,7 @@ public void testGetSimsExport() throws Exception {
}

@Test
public void testGetSimsExport_DefaultValues() throws Exception {
void testGetSimsExport_DefaultValues() throws Exception {
configureJwtDecoderMock(jwtDecoder, idep, timbre, List.of(Roles.ADMIN));

String id = "1234";
Expand Down

0 comments on commit b5ffed3

Please sign in to comment.