@Test public void noNameSuppliedWhenNamesDisabled() { ReplicantTestUtil.disableNames(); final ChannelSchema channelSchema = new ChannelSchema( ValueUtil.randomInt(), null, null, ChannelSchema.FilterType.NONE, null, ValueUtil.randomBoolean(), ValueUtil.randomBoolean(), Collections.emptyList() ); final IllegalStateException exception = expectThrows( IllegalStateException.class, channelSchema::getName ); assertEquals( exception.getMessage(), "Replicant-0044: ChannelSchema.getName() invoked when Replicant.areNamesEnabled() is false" ); assertEquals( channelSchema.toString(), "replicant.ChannelSchema@" + Integer.toHexString( channelSchema.hashCode() ) ); }
@Override public String toString() { if ( Replicant.areNamesEnabled() ) { return getName(); } else { return super.toString(); } }
ChannelSchema { @Override public String toString() { if ( Replicant.areNamesEnabled() ) { return getName(); } else { return super.toString(); } } }
ChannelSchema { @Override public String toString() { if ( Replicant.areNamesEnabled() ) { return getName(); } else { return super.toString(); } } ChannelSchema( final int id,
                        @Nullable final String name,
                        @Nullable final Class<?> instanceType,
                        @Nonnull final FilterType filterType,
                        @Nullable final SubscriptionUpdateEntityFilter<?> filter,
                        final boolean cacheable,
                        final boolean external,
                        @Nonnull final List<EntitySchema> entities ); }
ChannelSchema { @Override public String toString() { if ( Replicant.areNamesEnabled() ) { return getName(); } else { return super.toString(); } } ChannelSchema( final int id,
                        @Nullable final String name,
                        @Nullable final Class<?> instanceType,
                        @Nonnull final FilterType filterType,
                        @Nullable final SubscriptionUpdateEntityFilter<?> filter,
                        final boolean cacheable,
                        final boolean external,
                        @Nonnull final List<EntitySchema> entities ); int getId(); @Nonnull String getName(); boolean isTypeChannel(); boolean isInstanceChannel(); @Nullable Class<?> getInstanceType(); @Nonnull FilterType getFilterType(); @Nullable SubscriptionUpdateEntityFilter<?> getFilter(); boolean isCacheable(); boolean isExternal(); @Nonnull List<EntitySchema> getEntities(); @Nullable EntitySchema findEntityById( final int entityId ); @Override String toString(); }
ChannelSchema { @Override public String toString() { if ( Replicant.areNamesEnabled() ) { return getName(); } else { return super.toString(); } } ChannelSchema( final int id,
                        @Nullable final String name,
                        @Nullable final Class<?> instanceType,
                        @Nonnull final FilterType filterType,
                        @Nullable final SubscriptionUpdateEntityFilter<?> filter,
                        final boolean cacheable,
                        final boolean external,
                        @Nonnull final List<EntitySchema> entities ); int getId(); @Nonnull String getName(); boolean isTypeChannel(); boolean isInstanceChannel(); @Nullable Class<?> getInstanceType(); @Nonnull FilterType getFilterType(); @Nullable SubscriptionUpdateEntityFilter<?> getFilter(); boolean isCacheable(); boolean isExternal(); @Nonnull List<EntitySchema> getEntities(); @Nullable EntitySchema findEntityById( final int entityId ); @Override String toString();  }