Skip to content

Commit

Permalink
Refactor to consistent packageIdentifier naming
Browse files Browse the repository at this point in the history
  • Loading branch information
mnhock committed Jul 14, 2024
1 parent 3469916 commit dee3082
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/main/java/com/enofex/taikai/java/ImportsConfigurer.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public final class ImportsConfigurer extends AbstractConfigurer {
super(configurerContext);
}

public ImportsConfigurer shouldNotImport(String regex) {
return shouldNotImport(regex, null);
public ImportsConfigurer shouldNotImport(String packageIdentifier) {
return shouldNotImport(packageIdentifier, null);
}

public ImportsConfigurer shouldNotImport(String regex, Configuration configuration) {
public ImportsConfigurer shouldNotImport(String packageIdentifier, Configuration configuration) {
return addRule(TaikaiRule.of(noClasses()
.should().accessClassesThat()
.resideInAPackage(regex)
.as("No classes should have imports from %s".formatted(regex)), configuration));
.resideInAPackage(packageIdentifier)
.as("No classes should have imports from %s".formatted(packageIdentifier)), configuration));
}

public ImportsConfigurer shouldHaveNoCycles() {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/enofex/taikai/java/NamingConfigurer.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ public final class NamingConfigurer extends AbstractConfigurer {
super(configurerContext);
}

public NamingConfigurer packagesShouldMatch(String regex) {
return packagesShouldMatch(regex, null);
public NamingConfigurer packagesShouldMatch(String packageIdentifier) {
return packagesShouldMatch(packageIdentifier, null);
}

public NamingConfigurer packagesShouldMatch(String regex, Configuration configuration) {
public NamingConfigurer packagesShouldMatch(String packageIdentifier, Configuration configuration) {
return addRule(TaikaiRule.of(classes()
.should().resideInAPackage(regex)
.as("Package names should match %s".formatted(regex)),
.should().resideInAPackage(packageIdentifier)
.as("Package names should match %s".formatted(packageIdentifier)),
configuration));
}

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/enofex/taikai/spring/BootConfigurer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public final class BootConfigurer extends AbstractConfigurer {
super(configurerContext);
}

public BootConfigurer springBootApplicationShouldBeIn(String location) {
requireNonNull(location);
public BootConfigurer springBootApplicationShouldBeIn(String packageIdentifier) {
requireNonNull(packageIdentifier);

return springBootApplicationShouldBeIn(location, null);
return springBootApplicationShouldBeIn(packageIdentifier, null);
}

public BootConfigurer springBootApplicationShouldBeIn(String location, Configuration configuration) {
public BootConfigurer springBootApplicationShouldBeIn(String packageIdentifier, Configuration configuration) {
return addRule(TaikaiRule.of(classes()
.that(are(annotatedWithSpringBootApplication(true)))
.should().resideInAPackage(location)
.should().resideInAPackage(packageIdentifier)
.as("Classes annotated with %s should be located in %s".formatted(
ANNOTATION_SPRING_BOOT_APPLICATION, location)), configuration));
ANNOTATION_SPRING_BOOT_APPLICATION, packageIdentifier)), configuration));
}
}

0 comments on commit dee3082

Please sign in to comment.