Skip to content

Commit

Permalink
Change default class resolution behavior from simple to classpath. Fr…
Browse files Browse the repository at this point in the history
…om now on without any further configuration ArchUnit will look for missing classes on the classpath instead of using stubs. This should be less confusing when inheritance chains are broken due to classes missing from the import.

Resolves: #111
Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
  • Loading branch information
codecholeric committed Dec 16, 2018
1 parent dd23e4c commit 71c7a68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public final class ArchConfiguration {
private static final Pattern EXTENSION_PROP___GROUP_ONE_ID_GROUP_TWO_KEY = Pattern.compile("^extension\\.([^.]+)\\.(.+)");

private static final Map<String, String> PROPERTY_DEFAULTS = ImmutableMap.of(
RESOLVE_MISSING_DEPENDENCIES_FROM_CLASS_PATH, "" + false,
ENABLE_MD5_IN_CLASS_SOURCES, "" + false
RESOLVE_MISSING_DEPENDENCIES_FROM_CLASS_PATH, Boolean.TRUE.toString(),
ENABLE_MD5_IN_CLASS_SOURCES, Boolean.FALSE.toString()
);

private static final Supplier<ArchConfiguration> INSTANCE = Suppliers.memoize(new Supplier<ArchConfiguration>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ public void resolver_explicitly_set() {
@Test
public void reset_works() {
ArchConfiguration configuration = testConfiguration(PROPERTIES_RESOURCE_NAME);
assertThat(configuration.resolveMissingDependenciesFromClassPath()).isFalse();

configuration.setResolveMissingDependenciesFromClassPath(true);
assertThat(configuration.resolveMissingDependenciesFromClassPath()).isTrue();

configuration.reset();
configuration.setResolveMissingDependenciesFromClassPath(false);
assertThat(configuration.resolveMissingDependenciesFromClassPath()).isFalse();

configuration.reset();
assertThat(configuration.resolveMissingDependenciesFromClassPath()).isTrue();
}

@Test
Expand Down Expand Up @@ -189,7 +189,7 @@ private void writeProperties(Map<String, ?> props) {
}

private void assertDefault(ArchConfiguration configuration) {
assertThat(configuration.resolveMissingDependenciesFromClassPath()).isFalse();
assertThat(configuration.resolveMissingDependenciesFromClassPath()).isTrue();
assertThat(configuration.md5InClassSourcesEnabled()).isFalse();
}

Expand Down

0 comments on commit 71c7a68

Please sign in to comment.