Skip to content

Commit

Permalink
fixed Checkstyle warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-Draeger committed Mar 8, 2024
1 parent ad942fb commit 76f0956
Showing 1 changed file with 47 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
importOptions = {ImportOption.DoNotIncludeTests.class})
public class ArchitecturalRulesTest {

private static final DescribedPredicate<JavaAnnotation<?>> theTestIdentifierOfAStandardRequirement =
private static final DescribedPredicate<JavaAnnotation<?>> TEST_IDENTIFIER_OF_A_STANDARD_REQUIREMENT =
new DescribedPredicate<>("is annotated with the @TestIdentifier of a Standard "
+ "Requirement (not a Replacement Requirement)") {
@Override
Expand All @@ -78,18 +78,18 @@ public boolean test(final JavaAnnotation input) {
};

@ArchTest
private static final ArchRule doNotGiveRequirementsTextForStandardRequirements = noMethods()
private static final ArchRule DO_NOT_GIVE_REQUIREMENTS_TEXT_FOR_STANDARD_REQUIREMENTS = noMethods()
.that()
.areAnnotatedWith(TestIdentifier.class)
.should()
.beAnnotatedWith(theTestIdentifierOfAStandardRequirement)
.beAnnotatedWith(TEST_IDENTIFIER_OF_A_STANDARD_REQUIREMENT)
.andShould()
.beAnnotatedWith(DisplayName.class)
.because(
"Standard Requirements are copyrighted and should not be published as part of the SDCcc source code.");

@ArchTest
private static final ArchRule doNotUseOptionalGet = noClasses()
private static final ArchRule DO_NOT_USE_OPTIONAL_GET = noClasses()
.should()
.accessTargetWhere(target(owner(assignableTo(Optional.class))).and(nameMatching("get")))
.because("We want to use Optional.orElseThrow() instead of Optional.get().");
Expand All @@ -98,177 +98,179 @@ public boolean test(final JavaAnnotation input) {
private static final String REASON = "Use ImpliedValueUtil to retrieve %s from %s.";

@ArchTest
private static final ArchRule checkAbstractContextStateGetContextAssociation = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_CONTEXT_STATE_GET_CONTEXT_ASSOCIATION = checkImpliedValue(
"getContextAssociation",
AbstractContextState.class,
String.format(REASON, "context association", "AbstractContextState"));

@ArchTest
private static final ArchRule checkAbstractDescriptorGetDescriptorVersion = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_DESCRIPTOR_GET_DESCRIPTOR_VERSION = checkImpliedValue(
"getDescriptorVersion",
AbstractDescriptor.class,
String.format(REASON, "descriptor version", "AbstractDescriptor"));

@ArchTest
private static final ArchRule checkAbstractDescriptorGetSafetyClassification = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_DESCRIPTOR_GET_SAFETY_CLASSIFICATION = checkImpliedValue(
"getSafetyClassification",
AbstractDescriptor.class,
String.format(REASON, "safety classification", "AbstractDescriptor"));

@ArchTest
private static final ArchRule checkAbstractDeviceComponentStateGetActivationState = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_DEVICE_COMPONENT_STATE_GET_ACTIVATION_STATE = checkImpliedValue(
"getActivationState",
AbstractDeviceComponentState.class,
String.format(REASON, "activation state", "AbstractDeviceComponentState"));

@ArchTest
private static final ArchRule checkAbstractMetricStateGetActivationState = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_METRIC_STATE_GET_ACTIVATION_STATE = checkImpliedValue(
"getActivationState",
AbstractMetricState.class,
String.format(REASON, "activation state", "AbstractMetricState"));

@ArchTest
private static final ArchRule checkMetricQualityGetGenerationMode = checkImpliedValue(
private static final ArchRule CHECK_METRIC_QUALITY_GET_GENERATION_MODE = checkImpliedValue(
"getMode",
AbstractMetricValue.MetricQuality.class,
String.format(REASON, "generation mode", "AbstractMetricValue.MetricQuality"));

@ArchTest
private static final ArchRule checkMetricQualityGetQi = checkImpliedValue(
private static final ArchRule CHECK_METRIC_QUALITY_GET_QI = checkImpliedValue(
"getQi",
AbstractMetricValue.MetricQuality.class,
String.format(REASON, "quality indicator", "AbstractMetricValue.MetricQuality"));

@ArchTest
private static final ArchRule checkAbstractOperationDescriptorIsRetriggerable = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_OPERATION_DESCRIPTOR_IS_RETRIGGERABLE = checkImpliedValue(
"isRetriggerable",
AbstractOperationDescriptor.class,
String.format(REASON, "retriggerable", "AbstractOperationDescriptor"));

@ArchTest
private static final ArchRule checkAbstractOperationDescriptorGetAccessLevel = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_OPERATION_DESCRIPTOR_GET_ACCESS_LEVEL = checkImpliedValue(
"getAccessLevel",
AbstractOperationDescriptor.class,
String.format(REASON, "access level", "AbstractOperationDescriptor"));

@ArchTest
private static final ArchRule checkAbstractStateGetStateVersion = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_STATE_GET_STATE_VERSION = checkImpliedValue(
"getStateVersion", AbstractState.class, String.format(REASON, "state version", "AbstractState"));

@ArchTest
private static final ArchRule checkAbstractStateGetDescriptorVersion = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_STATE_GET_DESCRIPTOR_VERSION = checkImpliedValue(
"getDescriptorVersion", AbstractState.class, String.format(REASON, "descriptor version", "AbstractState"));

@ArchTest
private static final ArchRule checkAlertConditionDescriptorGetDefaultConditionGenerationDelay = checkImpliedValue(
"getDefaultConditionGenerationDelay",
AlertConditionDescriptor.class,
String.format(REASON, "default condition generation delay", "AlertConditionDescriptor"));
private static final ArchRule CHECK_ALERT_CONDITION_DESCRIPTOR_GET_DEFAULT_CONDITION_GENERATION_DELAY =
checkImpliedValue(
"getDefaultConditionGenerationDelay",
AlertConditionDescriptor.class,
String.format(REASON, "default condition generation delay", "AlertConditionDescriptor"));

@ArchTest
private static final ArchRule checkAlertConditionStateIsPresence = checkImpliedValue(
private static final ArchRule CHECK_ALERT_CONDITION_STATE_IS_PRESENCE = checkImpliedValue(
"isPresence", AlertConditionState.class, String.format(REASON, "presence", "AlertConditionState"));

@ArchTest
private static final ArchRule checkAlertSignalDescriptorGetDefaultSignalGenerationDelay = checkImpliedValue(
private static final ArchRule CHECK_ALERT_SIGNAL_DESCRIPTOR_GET_DEFAULT_SIGNAL_GENERATION_DELAY = checkImpliedValue(
"getDefaultSignalGenerationDelay",
AlertSignalDescriptor.class,
String.format(REASON, "default signal generation delay", "AlertSignalDescriptor"));

@ArchTest
private static final ArchRule checkAlertSignalDescriptorIsSignalDelegationSupported = checkImpliedValue(
private static final ArchRule CHECK_ALERT_SIGNAL_DESCRIPTOR_IS_SIGNAL_DELEGATION_SUPPORTED = checkImpliedValue(
"isSignalDelegationSupported",
AlertSignalDescriptor.class,
String.format(REASON, "signal delegation supported", "AlertSignalDescriptor"));

@ArchTest
private static final ArchRule checkAlertSignalDescriptorIsAcknowledgementSupported = checkImpliedValue(
private static final ArchRule CHECK_ALERT_SIGNAL_DESCRIPTOR_IS_ACKNOWLEDGEMENT_SUPPORTED = checkImpliedValue(
"isAcknowledgementSupported",
AlertSignalDescriptor.class,
String.format(REASON, "acknowledgement supported", "AlertSignalDescriptor"));

@ArchTest
private static final ArchRule checkAlertSignalStateGetPresence = checkImpliedValue(
private static final ArchRule CHECK_ALERT_SIGNAL_STATE_GET_PRESENCE = checkImpliedValue(
"getPresence", AlertSignalState.class, String.format(REASON, "presence", "AlertSignalState"));

@ArchTest
private static final ArchRule checkAlertSignalStateGetLocation = checkImpliedValue(
private static final ArchRule CHECK_ALERT_SIGNAL_STATE_GET_LOCATION = checkImpliedValue(
"getLocation", AlertSignalState.class, String.format(REASON, "location", "AlertSignalState"));

@ArchTest
private static final ArchRule checkCalibrationInfoGetType =
private static final ArchRule CHECK_CALIBRATION_INFO_GET_TYPE =
checkImpliedValue("getType", CalibrationInfo.class, String.format(REASON, "type", "CalibrationInfo"));

@ArchTest
private static final ArchRule checkClinicalInfoGetCriticality = checkImpliedValue(
private static final ArchRule CHECK_CLINICAL_INFO_GET_CRITICALITY = checkImpliedValue(
"getCriticality", ClinicalInfo.class, String.format(REASON, "criticality", "ClinicalInfo"));

@ArchTest
private static final ArchRule checkClockStateIsCriticalUse =
private static final ArchRule CHECK_CLOCK_STATE_IS_CRITICAL_USE =
checkImpliedValue("isCriticalUse", ClockState.class, String.format(REASON, "critical use", "ClockState"));

@ArchTest
private static final ArchRule checkCodedValueGetCodingSystem = checkImpliedValue(
private static final ArchRule CHECK_CODED_VALUE_GET_CODING_SYSTEM = checkImpliedValue(
"getCodingSystem", CodedValue.class, String.format(REASON, "coding system", "CodedValue"));

@ArchTest
private static final ArchRule checkLimitAlertConditionDescriptorIsAutoLimitSupported = checkImpliedValue(
private static final ArchRule CHECK_LIMIT_ALERT_CONDITION_DESCRIPTOR_IS_AUTO_LIMIT_SUPPORTED = checkImpliedValue(
"isAutoLimitSupported",
LimitAlertConditionDescriptor.class,
String.format(REASON, "auto limit supported", "LimitAlertConditionDescriptor"));

@ArchTest
private static final ArchRule checkMdDescriptionGetDescriptionVersion = checkImpliedValue(
private static final ArchRule CHECK_MD_DESCRIPTION_GET_DESCRIPTION_VERSION = checkImpliedValue(
"getDescriptionVersion",
MdDescription.class,
String.format(REASON, "description version", "MdDescription"));

@ArchTest
private static final ArchRule checkMdsStateGetLang =
private static final ArchRule CHECK_MDS_STATE_GET_LANG =
checkImpliedValue("getLang", MdsState.class, String.format(REASON, "language", "MdsState"));

@ArchTest
private static final ArchRule checkMdsStateGetOperatingMode =
private static final ArchRule CHECK_MDS_STATE_GET_OPERATING_MODE =
checkImpliedValue("getOperatingMode", MdsState.class, String.format(REASON, "operating mode", "MdsState"));

@ArchTest
private static final ArchRule checkMdStateGetStateVersion =
private static final ArchRule CHECK_MD_STATE_GET_STATE_VERSION =
checkImpliedValue("getStateVersion", MdState.class, String.format(REASON, "state version", "MdState"));

@ArchTest
private static final ArchRule checkMdibVersionGetVersion =
private static final ArchRule CHECK_MDIB_VERSION_GET_VERSION =
checkImpliedValue("getVersion", MdibVersion.class, String.format(REASON, "version", "MdibVersion"));

@ArchTest
private static final ArchRule checkDescriptionModificationReportReportPartGetModificationType = checkImpliedValue(
"getModificationType",
DescriptionModificationReport.ReportPart.class,
String.format(REASON, "modification type", "DescriptionModificationReport.ReportPart"));
private static final ArchRule CHECK_DESCRIPTION_MODIFICATION_REPORT_REPORT_PART_GET_MODIFICATION_TYPE =
checkImpliedValue(
"getModificationType",
DescriptionModificationReport.ReportPart.class,
String.format(REASON, "modification type", "DescriptionModificationReport.ReportPart"));

@ArchTest
private static final ArchRule checkObservedValueStreamValueGetStateVersion = checkImpliedValue(
private static final ArchRule CHECK_OBSERVED_VALUE_STREAM_VALUE_GET_STATE_VERSION = checkImpliedValue(
"getStateVersion",
ObservedValueStream.Value.class,
String.format(REASON, "state version", "ObservedValueStream.Value"));

@ArchTest
private static final ArchRule checkRetrievabilityInfoGetUpdatePeriod = checkImpliedValue(
private static final ArchRule CHECK_RETRIEVABILITY_INFO_GET_UPDATE_PERIOD = checkImpliedValue(
"getUpdatePeriod", RetrievabilityInfo.class, String.format(REASON, "update period", "RetrievabilityInfo"));

@ArchTest
private static final ArchRule checkAbstractReportMdibVersion = checkImpliedValue(
private static final ArchRule CHECK_ABSTRACT_REPORT_MDIB_VERSION = checkImpliedValue(
"getMdibVersion", AbstractReport.class, String.format(REASON, "mdib version", "AbstractReport"));

@ArchTest
private static final ArchRule checkMdibMdibVersion =
private static final ArchRule CHECK_MDIB_GET_MDIB_VERSION =
checkImpliedValue("getMdibVersion", Mdib.class, String.format(REASON, "mdib verison", "Mdib"));

@ArchTest
private static final ArchRule checkMdibInstanceId =
private static final ArchRule CHECK_MDIB_GET_INSTANCE_ID =
checkImpliedValue("getInstanceId", Mdib.class, String.format(REASON, "instance id", "Mdib"));

@ArchTest
private static final ArchRule checkDirectTestsInitialImpliedVersions = noClasses()
private static final ArchRule CHECK_DIRECT_TESTS_INITIAL_IMPLIED_VERSIONS = noClasses()
.that()
.resideInAPackage("..direct..")
.should()
Expand Down

0 comments on commit 76f0956

Please sign in to comment.