Subscription implements Anonymizable { @JsonIgnore public SubscriptionPolicy getSerialSubscriptionPolicy() { return serialSubscriptionPolicy; } private  Subscription(TopicName topicName,
                         String name,
                         EndpointAddress endpoint,
                         State state,
                         String description,
                         Object subscriptionPolicy,
                         boolean trackingEnabled,
                         TrackingMode trackingMode,
                         OwnerId owner,
                         String supportTeam,
                         MonitoringDetails monitoringDetails,
                         ContentType contentType,
                         DeliveryType deliveryType,
                         List<MessageFilterSpecification> filters,
                         SubscriptionMode mode,
                         List<Header> headers,
                         EndpointAddressResolverMetadata endpointAddressResolverMetadata,
                         SubscriptionOAuthPolicy oAuthPolicy,
                         boolean http2Enabled,
                         boolean subscriptionIdentityHeadersEnabled); static Subscription createSerialSubscription(TopicName topicName,
                                                        String name,
                                                        EndpointAddress endpoint,
                                                        State state,
                                                        String description,
                                                        SubscriptionPolicy subscriptionPolicy,
                                                        boolean trackingEnabled,
                                                        TrackingMode trackingMode,
                                                        OwnerId owner,
                                                        String supportTeam,
                                                        MonitoringDetails monitoringDetails,
                                                        ContentType contentType,
                                                        List<MessageFilterSpecification> filters,
                                                        SubscriptionMode mode,
                                                        List<Header> headers,
                                                        EndpointAddressResolverMetadata endpointAddressResolverMetadata,
                                                        SubscriptionOAuthPolicy oAuthPolicy,
                                                        boolean http2Enabled,
                                                        boolean subscriptionIdentityHeadersEnabled); static Subscription createBatchSubscription(TopicName topicName,
                                                       String name,
                                                       EndpointAddress endpoint,
                                                       State state,
                                                       String description,
                                                       BatchSubscriptionPolicy subscriptionPolicy,
                                                       boolean trackingEnabled,
                                                       TrackingMode trackingMode,
                                                       OwnerId owner,
                                                       String supportTeam,
                                                       MonitoringDetails monitoringDetails,
                                                       ContentType contentType,
                                                       List<MessageFilterSpecification> filters,
                                                       List<Header> headers,
                                                       EndpointAddressResolverMetadata endpointAddressResolverMetadata,
                                                       SubscriptionOAuthPolicy oAuthPolicy,
                                                       boolean http2Enabled,
                                                       boolean subscriptionIdentityHeadersEnabled); @JsonCreator static Subscription create(
            @JsonProperty("topicName") String topicName,
            @JsonProperty("name") String name,
            @JsonProperty("endpoint") EndpointAddress endpoint,
            @JsonProperty("state") State state,
            @JsonProperty("description") String description,
            @JsonProperty("subscriptionPolicy") Map<String, Object> subscriptionPolicy,
            @JsonProperty("trackingEnabled") boolean trackingEnabled,
            @JsonProperty("trackingMode") String trackingMode,
            @JsonProperty("owner") OwnerId owner,
            @JsonProperty("supportTeam") String supportTeam,
            @JsonProperty("monitoringDetails") MonitoringDetails monitoringDetails,
            @JsonProperty("contentType") ContentType contentType,
            @JsonProperty("deliveryType") DeliveryType deliveryType,
            @JsonProperty("filters") List<MessageFilterSpecification> filters,
            @JsonProperty("mode") SubscriptionMode mode,
            @JsonProperty("headers") List<Header> headers,
            @JsonProperty("endpointAddressResolverMetadata") EndpointAddressResolverMetadata endpointAddressResolverMetadata,
            @JsonProperty("oAuthPolicy") SubscriptionOAuthPolicy oAuthPolicy,
            @JsonProperty("http2Enabled") boolean http2Enabled,
            @JsonProperty("subscriptionIdentityHeadersEnabled") boolean subscriptionIdentityHeadersEnabled); @Override int hashCode(); @Override boolean equals(Object obj); @JsonIgnore SubscriptionName getQualifiedName(); EndpointAddress getEndpoint(); @JsonProperty("topicName") String getQualifiedTopicName(); @JsonIgnore TopicName getTopicName(); String getName(); String getDescription(); void setSerialSubscriptionPolicy(SubscriptionPolicy serialSubscriptionPolicy); State getState(); void setState(State state); @JsonProperty("subscriptionPolicy") Object getSubscriptionPolicy(); boolean isTrackingEnabled(); @JsonProperty("trackingMode") String getTrackingModeString(); @JsonIgnore TrackingMode getTrackingMode(); OwnerId getOwner(); @Deprecated String getSupportTeam(); MonitoringDetails getMonitoringDetails(); ContentType getContentType(); DeliveryType getDeliveryType(); List<MessageFilterSpecification> getFilters(); List<Header> getHeaders(); EndpointAddressResolverMetadata getEndpointAddressResolverMetadata(); @JsonIgnore boolean isBatchSubscription(); @JsonIgnore BatchSubscriptionPolicy getBatchSubscriptionPolicy(); @JsonIgnore SubscriptionPolicy getSerialSubscriptionPolicy(); @JsonIgnore boolean isActive(); SubscriptionMode getMode(); @JsonProperty("oAuthPolicy") SubscriptionOAuthPolicy getOAuthPolicy(); @JsonIgnore boolean hasOAuthPolicy(); @JsonIgnore boolean isSeverityNotImportant(); boolean isHttp2Enabled(); boolean isSubscriptionIdentityHeadersEnabled(); Instant getCreatedAt(); void setCreatedAt(Long createdAt); Instant getModifiedAt(); void setModifiedAt(Long modifiedAt); @Override Subscription anonymize(); @Override String toString();  }
@Test public void shouldDeserializeSubscriptionWithoutBackoff() throws Exception { String json = "{\"name\": \"test\", \"endpoint\": \"http: Subscription subscription = mapper.readValue(json, Subscription.class); assertThat(subscription.getSerialSubscriptionPolicy().getMessageBackoff()).isEqualTo(100); }
@Test public void shouldReadIntBackoffMultiplier() throws Exception{ String json = "{\"name\": \"test\", \"endpoint\": \"http: Subscription subscription = mapper.readValue(json, Subscription.class); assertThat(subscription.getSerialSubscriptionPolicy().getBackoffMultiplier()).isEqualTo(3); }