Browse Source

Fix HashPartitionServiceTest

pull/12743/head
ViacheslavKlimov 1 year ago
parent
commit
ab9bef4d90
  1. 3
      application/src/test/java/org/thingsboard/server/queue/discovery/HashPartitionServiceTest.java
  2. 4
      common/queue/src/main/java/org/thingsboard/server/queue/discovery/HashPartitionService.java

3
application/src/test/java/org/thingsboard/server/queue/discovery/HashPartitionServiceTest.java

@ -426,6 +426,9 @@ public class HashPartitionServiceTest {
topicService);
ReflectionTestUtils.setField(partitionService, "coreTopic", "tb.core");
ReflectionTestUtils.setField(partitionService, "corePartitions", 10);
ReflectionTestUtils.setField(partitionService, "cfEventTopic", "tb_cf_event");
ReflectionTestUtils.setField(partitionService, "cfStateTopic", "tb_cf_state");
ReflectionTestUtils.setField(partitionService, "cfPartitions", 10);
ReflectionTestUtils.setField(partitionService, "vcTopic", "tb.vc");
ReflectionTestUtils.setField(partitionService, "vcPartitions", 10);
ReflectionTestUtils.setField(partitionService, "hashFunctionName", hashFunctionName);

4
common/queue/src/main/java/org/thingsboard/server/queue/discovery/HashPartitionService.java

@ -62,9 +62,9 @@ public class HashPartitionService implements PartitionService {
private String coreTopic;
@Value("${queue.core.partitions:10}")
private Integer corePartitions;
@Value("${queue.calculated_fields.event_topic}")
@Value("${queue.calculated_fields.event_topic:tb_cf_event}")
private String cfEventTopic;
@Value("${queue.calculated_fields.state_topic}")
@Value("${queue.calculated_fields.state_topic:tb_cf_state}")
private String cfStateTopic;
@Value("${queue.calculated_fields.partitions:10}")
private Integer cfPartitions;

Loading…
Cancel
Save