@Override
    public void init(TbContext ctx, TbNodeConfiguration configuration) throws TbNodeException {
        this.config = TbNodeUtils.convert(configuration, CalculateDeltaNodeConfiguration.class);
        if (StringUtils.isBlank(config.getInputValueKey())) {
            throw new TbNodeException("Input value key should be specified!", true);
        }
        if (StringUtils.isBlank(config.getOutputValueKey())) {
            throw new TbNodeException("Output value key should be specified!", true);
        }
        if (config.isAddPeriodBetweenMsgs() && StringUtils.isBlank(config.getPeriodValueKey())) {
            throw new TbNodeException("Period value key should be specified!", true);
        }
        locks = new ConcurrentReferenceHashMap<>(16, ConcurrentReferenceHashMap.ReferenceType.WEAK);
        if (config.isUseCache()) {
            cache = new ConcurrentReferenceHashMap<>(16, ConcurrentReferenceHashMap.ReferenceType.SOFT);
        }
    }
@Test
    public void givenInvalidPeriodKeyAndAddPeriodDisabled_whenInitThenNoExceptionThrown() {
        config.setPeriodValueKey(null);
        config.setAddPeriodBetweenMsgs(false);
        nodeConfiguration = new TbNodeConfiguration(JacksonUtil.valueToTree(config));
        assertDoesNotThrow(() -> node.init(ctxMock, nodeConfiguration));
    }