@Override public int hashCode() { int result = eventId != null ? eventId.hashCode() : 0; result = 31 * result + (billingPeriod != null ? billingPeriod.hashCode() : 0); result = 31 * result + (effectiveDate != null ? effectiveDate.hashCode() : 0); result = 31 * result + (plan != null ? plan.hashCode() : 0); result = 31 * result + (product != null ? product.hashCode() : 0); result = 31 * result + (priceList != null ? priceList.hashCode() : 0); result = 31 * result + (eventType != null ? eventType.hashCode() : 0); result = 31 * result + (isBlockedBilling != null ? isBlockedBilling.hashCode() : 0); result = 31 * result + (isBlockedEntitlement != null ? isBlockedEntitlement.hashCode() : 0); result = 31 * result + (serviceName != null ? serviceName.hashCode() : 0); result = 31 * result + (serviceStateName != null ? serviceStateName.hashCode() : 0); result = 31 * result + (phase != null ? phase.hashCode() : 0); return result; } }
return false; if (eventType != null ? !eventType.equals(that.eventType) : that.eventType != null) { return false;
@Override public boolean apply(final SubscriptionEvent event) { return event.getSubscriptionEventType() != null && // We want events coming from the blocking states table... ObjectType.BLOCKING_STATES.equals(event.getSubscriptionEventType().getObjectType()) && // ...that are for any service but entitlement !ENTITLEMENT_SERVICE_NAME.equals(event.getServiceName()); } }
private static List<AuditLog> getAuditLogsForSubscriptionEvent(final SubscriptionEvent subscriptionEvent, @Nullable final AccountAuditLogs accountAuditLogs) { if (accountAuditLogs == null) { return null; } final ObjectType subscriptionEventObjectType = subscriptionEvent.getSubscriptionEventType().getObjectType(); if (subscriptionEventObjectType == ObjectType.SUBSCRIPTION_EVENT) { return accountAuditLogs.getAuditLogsForSubscriptionEvent(subscriptionEvent.getId()); } else if (subscriptionEventObjectType == ObjectType.BLOCKING_STATES) { return accountAuditLogs.getAuditLogsForBlockingState(subscriptionEvent.getId()); } throw new IllegalStateException("Unepxected objectType " + subscriptionEventObjectType + " for SubscriptionEvent " + subscriptionEvent.getId()); }
private void checkSubscriptionEventAuditLog(final List<SubscriptionEvent> transitions, final int idx, final SubscriptionEventType expectedType) { assertEquals(transitions.get(idx).getSubscriptionEventType(), expectedType); final List<AuditLog> auditLogs = auditUserApi.getAuditLogs(transitions.get(idx).getId(), transitions.get(idx).getSubscriptionEventType().getObjectType(), AuditLevel.FULL, callContext); assertEquals(auditLogs.size(), 1); assertEquals(auditLogs.get(0).getChangeType(), ChangeType.INSERT); } }
@Override public int hashCode() { int result = dryRunType != null ? dryRunType.hashCode() : 0; result = 31 * result + (entitlementSpecifier != null ? entitlementSpecifier.hashCode() : 0); result = 31 * result + (action != null ? action.hashCode() : 0); result = 31 * result + (subscriptionId != null ? subscriptionId.hashCode() : 0); result = 31 * result + (effectiveDate != null ? effectiveDate.hashCode() : 0); result = 31 * result + (bundleId != null ? bundleId.hashCode() : 0); result = 31 * result + (billingActionPolicy != null ? billingActionPolicy.hashCode() : 0); return result; } }
return false; if (dryRunAction != null ? !dryRunAction.equals(that.dryRunAction) : that.dryRunAction != null) { return false;
@Override public int hashCode() { int result = dryRunAction != null ? dryRunAction.hashCode() : 0; result = 31 * result + (dryRunType != null ? dryRunType.hashCode() : 0); result = 31 * result + (phaseType != null ? phaseType.hashCode() : 0); result = 31 * result + (productName != null ? productName.hashCode() : 0); result = 31 * result + (productCategory != null ? productCategory.hashCode() : 0); result = 31 * result + (billingPeriod != null ? billingPeriod.hashCode() : 0); result = 31 * result + (priceListName != null ? priceListName.hashCode() : 0); result = 31 * result + (effectiveDate != null ? effectiveDate.hashCode() : 0); result = 31 * result + (subscriptionId != null ? subscriptionId.hashCode() : 0); result = 31 * result + (bundleId != null ? bundleId.hashCode() : 0); result = 31 * result + (billingPolicy != null ? billingPolicy.hashCode() : 0); result = 31 * result + (priceOverrides != null ? priceOverrides.hashCode() : 0); return result; } }
if (SubscriptionEventType.START_BILLING.equals(dryRunSubscriptionSpec.getDryRunAction())) { verifyNonNullOrEmpty(dryRunSubscriptionSpec.getProductName(), "DryRun subscription product category should be specified"); verifyNonNullOrEmpty(dryRunSubscriptionSpec.getBillingPeriod(), "DryRun subscription billingPeriod should be specified"); verifyNonNullOrEmpty(dryRunSubscriptionSpec.getBundleId(), "DryRun bundle ID should be specified"); } else if (SubscriptionEventType.CHANGE.equals(dryRunSubscriptionSpec.getDryRunAction())) { verifyNonNullOrEmpty(dryRunSubscriptionSpec.getProductName(), "DryRun subscription product category should be specified"); verifyNonNullOrEmpty(dryRunSubscriptionSpec.getBillingPeriod(), "DryRun subscription billingPeriod should be specified"); verifyNonNullOrEmpty(dryRunSubscriptionSpec.getSubscriptionId(), "DryRun subscriptionID should be specified"); } else if (SubscriptionEventType.STOP_BILLING.equals(dryRunSubscriptionSpec.getDryRunAction())) { verifyNonNullOrEmpty(dryRunSubscriptionSpec.getSubscriptionId(), "DryRun subscriptionID should be specified");