use of com.tngtech.archunit.core.importer.ClassFileImporter in project hazelcast by hazelcast.
the class ArchUnitRulesTest method should_fail_with_non_compliant_class.
@Test
public void should_fail_with_non_compliant_class() {
JavaClasses classes = new ClassFileImporter().withImportOption(ONLY_INCLUDE_TESTS).importPackages("com.example.broken");
assertThat(classes).isNotEmpty();
assertThatThrownBy(() -> ArchUnitRules.SERIALIZABLE_SHOULD_HAVE_VALID_SERIAL_VERSION_UID.check(classes)).isInstanceOf(AssertionError.class).hasMessageContaining("was violated (1 times)");
}
use of com.tngtech.archunit.core.importer.ClassFileImporter in project hazelcast by hazelcast.
the class ArchUnitRulesTest method should_NOT_fail_with_non_compliant_class.
@Test
public void should_NOT_fail_with_non_compliant_class() {
JavaClasses classes = new ClassFileImporter().withImportOption(ONLY_INCLUDE_TESTS).importPackages("com.example.valid");
assertThat(classes).isNotEmpty();
ArchUnitRules.SERIALIZABLE_SHOULD_HAVE_VALID_SERIAL_VERSION_UID.check(classes);
}
use of com.tngtech.archunit.core.importer.ClassFileImporter in project hazelcast by hazelcast.
the class S3SerializableTest method serializable_classes_should_have_valid_serialVersionUID.
@Test
public void serializable_classes_should_have_valid_serialVersionUID() {
String basePackage = S3Sources.class.getPackage().getName();
JavaClasses classes = new ClassFileImporter().withImportOption(onlyCurrentModule()).importPackages(basePackage);
ArchUnitRules.SERIALIZABLE_SHOULD_HAVE_VALID_SERIAL_VERSION_UID.check(classes);
}
use of com.tngtech.archunit.core.importer.ClassFileImporter in project hazelcast by hazelcast.
the class Elastic7SerializableTest method serializable_classes_should_have_valid_serialVersionUID.
@Test
public void serializable_classes_should_have_valid_serialVersionUID() {
String basePackage = ElasticSources.class.getPackage().getName();
JavaClasses classes = new ClassFileImporter().withImportOption(onlyCurrentModule()).importPackages(basePackage);
ArchUnitRules.SERIALIZABLE_SHOULD_HAVE_VALID_SERIAL_VERSION_UID.check(classes);
}
use of com.tngtech.archunit.core.importer.ClassFileImporter in project hazelcast by hazelcast.
the class GrpcSerializableTest method serializable_classes_should_have_valid_serialVersionUID.
@Test
public void serializable_classes_should_have_valid_serialVersionUID() {
String basePackage = GrpcService.class.getPackage().getName();
JavaClasses classes = new ClassFileImporter().withImportOption(onlyCurrentModule()).importPackages(basePackage);
ArchUnitRules.SERIALIZABLE_SHOULD_HAVE_VALID_SERIAL_VERSION_UID.check(classes);
}
Aggregations