diff --git a/boot-api-archunit-sample/src/main/java/com/example/archunit/exception/ResourceNotFoundException.java b/boot-api-archunit-sample/src/main/java/com/example/archunit/exception/ResourceNotFoundException.java index 4f0282ef5..fe6f4d545 100644 --- a/boot-api-archunit-sample/src/main/java/com/example/archunit/exception/ResourceNotFoundException.java +++ b/boot-api-archunit-sample/src/main/java/com/example/archunit/exception/ResourceNotFoundException.java @@ -5,13 +5,13 @@ public class ResourceNotFoundException extends RuntimeException { - private static final HttpStatus httpStatus = HttpStatus.NOT_FOUND; + private static final HttpStatus HTTP_STATUS = HttpStatus.NOT_FOUND; public ResourceNotFoundException(String errorMessage) { super(errorMessage); } public HttpStatusCode getHttpStatus() { - return httpStatus; + return HTTP_STATUS; } } diff --git a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/GeneralCodingRulesTest.java b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/GeneralCodingRulesTest.java index de27a62ea..4e2c7af16 100644 --- a/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/GeneralCodingRulesTest.java +++ b/boot-api-archunit-sample/src/test/java/com/example/archunit/architecture/GeneralCodingRulesTest.java @@ -8,6 +8,7 @@ import static com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_USE_JAVA_UTIL_LOGGING; import static com.tngtech.archunit.library.GeneralCodingRules.NO_CLASSES_SHOULD_USE_JODATIME; +import com.tngtech.archunit.core.domain.JavaModifier; import com.tngtech.archunit.core.importer.ImportOption; import com.tngtech.archunit.junit.AnalyzeClasses; import com.tngtech.archunit.junit.ArchTest; @@ -48,14 +49,18 @@ class GeneralCodingRulesTest { .haveName("LOGGER") .because("Logger variables should be private, static and final, and it should be named as LOGGER"); - /* @ArchTest - static final ArchRule finalStaticVariablesInUppercase = fields().that().areStatic().and().areFinal() - .and().doNotHaveName("serialVersionUID") - .and().doNotHaveModifier(JavaModifier.SYNTHETIC) - .should().haveNameMatching(".*^[A-Z].*") + static final ArchRule finalStaticVariablesInUppercase = fields().that() + .areStatic() + .and() + .areFinal() + .and() + .doNotHaveName("serialVersionUID") + .and() + .doNotHaveModifier(JavaModifier.SYNTHETIC) + .should() + .haveNameMatching(".*^[A-Z].*") .because("Variables with static and final modifiers should be named in uppercase"); - */ // Methods @ArchTest