Skip to content

Commit

Permalink
fix: added test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Peterson <[email protected]>
  • Loading branch information
mattp-swirldslabs committed Sep 10, 2024
1 parent df70117 commit 0bba7c5
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import static org.junit.jupiter.api.Assertions.*;

import com.hedera.block.server.consumer.ConsumerConfig;
import com.hedera.block.server.mediator.MediatorConfig;
import com.hedera.block.server.notifier.NotifierConfig;
import com.hedera.block.server.persistence.storage.PersistenceStorageConfig;
import com.hedera.block.server.util.TestConfigUtil;
import com.swirlds.common.metrics.config.MetricsConfig;
Expand Down Expand Up @@ -91,4 +93,30 @@ void testProvideConsumerConfig() throws IOException {
assertNotNull(providedConfig);
assertSame(consumerConfig, providedConfig);
}

@Test
void testProvideMediatorConfig() throws IOException {
BlockNodeContext context = TestConfigUtil.getTestBlockNodeContext();
Configuration configuration = context.configuration();
MediatorConfig mediatorConfig = configuration.getConfigData(MediatorConfig.class);

MediatorConfig providedConfig = ConfigInjectionModule.provideMediatorConfig(configuration);

// Verify the config
assertNotNull(providedConfig);
assertSame(mediatorConfig, providedConfig);
}

@Test
void testProvideNotifierConfig() throws IOException {
BlockNodeContext context = TestConfigUtil.getTestBlockNodeContext();
Configuration configuration = context.configuration();
NotifierConfig notifierConfig = configuration.getConfigData(NotifierConfig.class);

NotifierConfig providedConfig = ConfigInjectionModule.provideNotifierConfig(configuration);

// Verify the config
assertNotNull(providedConfig);
assertSame(notifierConfig, providedConfig);
}
}

0 comments on commit 0bba7c5

Please sign in to comment.