-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ricardo Mello
committed
Nov 4, 2020
1 parent
a806696
commit bccc484
Showing
7 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package br.com.ricas.domain; | ||
package br.com.ricas.model; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package br.com.ricas.domain; | ||
package br.com.ricas.model; | ||
|
||
import br.com.ricas.FinanceType; | ||
import lombok.Getter; | ||
|
24 changes: 24 additions & 0 deletions
24
core/src/test/java/br/com/ricas/archunit/CleanArchRuleDefinition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package br.com.ricas.archunit; | ||
|
||
import com.tngtech.archunit.core.domain.JavaClasses; | ||
import com.tngtech.archunit.core.importer.ClassFileImporter; | ||
import com.tngtech.archunit.junit.AnalyzeClasses; | ||
import com.tngtech.archunit.lang.ArchRule; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes; | ||
|
||
@AnalyzeClasses(packages = "br.com.ricas") | ||
class CleanArchRuleDefinition { | ||
|
||
@Test | ||
public void model_should_only_be_accessed_by_model() { | ||
JavaClasses importedClasses = new ClassFileImporter().importPackages("br.com.ricas"); | ||
|
||
ArchRule myRule = classes() | ||
.that().resideInAPackage("br.com.ricas.model..") | ||
.should().onlyBeAccessed().byAnyPackage("br.com.ricas.model.."); | ||
|
||
myRule.check(importedClasses); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...va/br/com/ricas/domain/CategoryTests.java → ...ava/br/com/ricas/model/CategoryTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package br.com.ricas.domain; | ||
package br.com.ricas.model; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
...ava/br/com/ricas/domain/FinanceTests.java → ...java/br/com/ricas/model/FinanceTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters