diff --git a/sonar-project.properties b/sonar-project.properties index 9f3f391..638e7a5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -15,7 +15,7 @@ sonar.typescript.lcov.reportPaths=target/test-results/lcov.info sonar.sourceEncoding=UTF-8 sonar.exclusions=src/main/webapp/content/**/*.*, src/main/webapp/i18n/*.js, target/classes/static/**/*.*, **/main/resources/**/*, **/test/**/*, **/main/webapp/app/admin/**/*, **/aop/logging/*, **/dto/custom/builder/* - +sonar.cpd.exclusions=**/ApplicationProperties.java sonar.issue.ignore.multicriteria=S3437,S4502,S4684,UndocumentedApi,BoldAndItalicTagsCheck # Rule https://sonarcloud.io/coding_rules?open=squid%3AS3437&rule_key=squid%3AS3437 is ignored, as a JPA-managed field cannot be transient sonar.issue.ignore.multicriteria.S3437.resourceKey=src/main/java/**/* diff --git a/src/main/java/com/github/microcatalog/repository/StatusRepository.java b/src/main/java/com/github/microcatalog/repository/StatusRepository.java index c2a6cf3..877b37c 100644 --- a/src/main/java/com/github/microcatalog/repository/StatusRepository.java +++ b/src/main/java/com/github/microcatalog/repository/StatusRepository.java @@ -1,13 +1,9 @@ package com.github.microcatalog.repository; -import com.github.microcatalog.domain.Microservice; import com.github.microcatalog.domain.Status; - -import org.springframework.data.jpa.repository.*; +import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; -import java.util.List; - /** * Spring Data repository for the Status entity. */ diff --git a/src/test/java/com/github/microcatalog/web/rest/DependencyResourceIT.java b/src/test/java/com/github/microcatalog/web/rest/DependencyResourceIT.java index 5bae0eb..61b7125 100644 --- a/src/test/java/com/github/microcatalog/web/rest/DependencyResourceIT.java +++ b/src/test/java/com/github/microcatalog/web/rest/DependencyResourceIT.java @@ -30,7 +30,7 @@ @SpringBootTest(classes = MicrocatalogApp.class) @AutoConfigureMockMvc @WithMockUser -public class DependencyResourceIT { +class DependencyResourceIT { private static final String DEFAULT_NAME = "AAAAAAAAAA"; private static final String UPDATED_NAME = "BBBBBBBBBB"; @@ -104,7 +104,7 @@ public void initTest() { @Test @Transactional - public void createDependency() throws Exception { + void createDependency() throws Exception { int databaseSizeBeforeCreate = dependencyRepository.findAll().size(); // Create the Dependency restDependencyMockMvc.perform(post("/api/dependencies") @@ -122,7 +122,7 @@ public void createDependency() throws Exception { @Test @Transactional - public void createDependencyWithExistingId() throws Exception { + void createDependencyWithExistingId() throws Exception { int databaseSizeBeforeCreate = dependencyRepository.findAll().size(); // Create the Dependency with an existing ID @@ -142,7 +142,7 @@ public void createDependencyWithExistingId() throws Exception { @Test @Transactional - public void checkNameIsRequired() throws Exception { + void checkNameIsRequired() throws Exception { int databaseSizeBeforeTest = dependencyRepository.findAll().size(); // set the field null dependency.setName(null); @@ -161,7 +161,7 @@ public void checkNameIsRequired() throws Exception { @Test @Transactional - public void getAllDependencies() throws Exception { + void getAllDependencies() throws Exception { // Initialize the database dependencyRepository.saveAndFlush(dependency); @@ -176,7 +176,7 @@ public void getAllDependencies() throws Exception { @Test @Transactional - public void getDependency() throws Exception { + void getDependency() throws Exception { // Initialize the database dependencyRepository.saveAndFlush(dependency); @@ -191,7 +191,7 @@ public void getDependency() throws Exception { @Test @Transactional - public void getNonExistingDependency() throws Exception { + void getNonExistingDependency() throws Exception { // Get the dependency restDependencyMockMvc.perform(get("/api/dependencies/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); @@ -199,7 +199,7 @@ public void getNonExistingDependency() throws Exception { @Test @Transactional - public void updateDependency() throws Exception { + void updateDependency() throws Exception { // Initialize the database dependencyRepository.saveAndFlush(dependency); @@ -228,7 +228,7 @@ public void updateDependency() throws Exception { @Test @Transactional - public void updateNonExistingDependency() throws Exception { + void updateNonExistingDependency() throws Exception { int databaseSizeBeforeUpdate = dependencyRepository.findAll().size(); // If the entity doesn't have an ID, it will throw BadRequestAlertException @@ -244,7 +244,7 @@ public void updateNonExistingDependency() throws Exception { @Test @Transactional - public void deleteDependency() throws Exception { + void deleteDependency() throws Exception { // Initialize the database dependencyRepository.saveAndFlush(dependency); diff --git a/src/test/java/com/github/microcatalog/web/rest/MicroserviceResourceIT.java b/src/test/java/com/github/microcatalog/web/rest/MicroserviceResourceIT.java index 842c81c..6be879a 100644 --- a/src/test/java/com/github/microcatalog/web/rest/MicroserviceResourceIT.java +++ b/src/test/java/com/github/microcatalog/web/rest/MicroserviceResourceIT.java @@ -30,7 +30,7 @@ @SpringBootTest(classes = MicrocatalogApp.class) @AutoConfigureMockMvc @WithMockUser -public class MicroserviceResourceIT { +class MicroserviceResourceIT { private static final String DEFAULT_NAME = "AAAAAAAAAA"; private static final String UPDATED_NAME = "BBBBBBBBBB"; @@ -145,7 +145,7 @@ public void initTest() { @Test @Transactional - public void createMicroservice() throws Exception { + void createMicroservice() throws Exception { int databaseSizeBeforeCreate = microserviceRepository.findAll().size(); // Create the Microservice restMicroserviceMockMvc.perform(post("/api/microservices") @@ -167,7 +167,7 @@ public void createMicroservice() throws Exception { @Test @Transactional - public void createMicroserviceWithExistingId() throws Exception { + void createMicroserviceWithExistingId() throws Exception { int databaseSizeBeforeCreate = microserviceRepository.findAll().size(); // Create the Microservice with an existing ID @@ -187,7 +187,7 @@ public void createMicroserviceWithExistingId() throws Exception { @Test @Transactional - public void checkNameIsRequired() throws Exception { + void checkNameIsRequired() throws Exception { int databaseSizeBeforeTest = microserviceRepository.findAll().size(); // set the field null microservice.setName(null); @@ -206,7 +206,7 @@ public void checkNameIsRequired() throws Exception { @Test @Transactional - public void checkImageUrlIsRequired() throws Exception { + void checkImageUrlIsRequired() throws Exception { int databaseSizeBeforeTest = microserviceRepository.findAll().size(); // set the field null microservice.setImageUrl(null); @@ -225,7 +225,7 @@ public void checkImageUrlIsRequired() throws Exception { @Test @Transactional - public void checkSwaggerUrlIsRequired() throws Exception { + void checkSwaggerUrlIsRequired() throws Exception { int databaseSizeBeforeTest = microserviceRepository.findAll().size(); // set the field null microservice.setSwaggerUrl(null); @@ -244,7 +244,7 @@ public void checkSwaggerUrlIsRequired() throws Exception { @Test @Transactional - public void checkGitUrlIsRequired() throws Exception { + void checkGitUrlIsRequired() throws Exception { int databaseSizeBeforeTest = microserviceRepository.findAll().size(); // set the field null microservice.setGitUrl(null); @@ -263,7 +263,7 @@ public void checkGitUrlIsRequired() throws Exception { @Test @Transactional - public void checkCiUrlIsRequired() throws Exception { + void checkCiUrlIsRequired() throws Exception { int databaseSizeBeforeTest = microserviceRepository.findAll().size(); // set the field null microservice.setCiUrl(null); @@ -282,7 +282,7 @@ public void checkCiUrlIsRequired() throws Exception { @Test @Transactional - public void getAllMicroservices() throws Exception { + void getAllMicroservices() throws Exception { // Initialize the database microserviceRepository.saveAndFlush(microservice); @@ -301,7 +301,7 @@ public void getAllMicroservices() throws Exception { @Test @Transactional - public void getMicroservice() throws Exception { + void getMicroservice() throws Exception { // Initialize the database microserviceRepository.saveAndFlush(microservice); @@ -319,7 +319,7 @@ public void getMicroservice() throws Exception { } @Test @Transactional - public void getNonExistingMicroservice() throws Exception { + void getNonExistingMicroservice() throws Exception { // Get the microservice restMicroserviceMockMvc.perform(get("/api/microservices/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); @@ -327,7 +327,7 @@ public void getNonExistingMicroservice() throws Exception { @Test @Transactional - public void updateMicroservice() throws Exception { + void updateMicroservice() throws Exception { // Initialize the database microserviceRepository.saveAndFlush(microservice); @@ -364,7 +364,7 @@ public void updateMicroservice() throws Exception { @Test @Transactional - public void updateNonExistingMicroservice() throws Exception { + void updateNonExistingMicroservice() throws Exception { int databaseSizeBeforeUpdate = microserviceRepository.findAll().size(); // If the entity doesn't have an ID, it will throw BadRequestAlertException @@ -380,7 +380,7 @@ public void updateNonExistingMicroservice() throws Exception { @Test @Transactional - public void deleteMicroservice() throws Exception { + void deleteMicroservice() throws Exception { // Initialize the database microserviceRepository.saveAndFlush(microservice);