Skip to content

Commit

Permalink
Code cleanup #124
Browse files Browse the repository at this point in the history
  • Loading branch information
tillias committed Jan 13, 2021
1 parent 4881216 commit d9cbb22
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 30 deletions.
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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")
Expand All @@ -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
Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -191,15 +191,15 @@ 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());
}

@Test
@Transactional
public void updateDependency() throws Exception {
void updateDependency() throws Exception {
// Initialize the database
dependencyRepository.saveAndFlush(dependency);

Expand Down Expand Up @@ -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
Expand All @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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")
Expand All @@ -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
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -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);

Expand All @@ -319,15 +319,15 @@ 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());
}

@Test
@Transactional
public void updateMicroservice() throws Exception {
void updateMicroservice() throws Exception {
// Initialize the database
microserviceRepository.saveAndFlush(microservice);

Expand Down Expand Up @@ -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
Expand All @@ -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);

Expand Down

0 comments on commit d9cbb22

Please sign in to comment.