|
|
|
@ -18,6 +18,7 @@ package org.thingsboard.rule.engine.metadata; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.jupiter.api.Assertions; |
|
|
|
import org.thingsboard.common.util.JacksonUtil; |
|
|
|
import org.thingsboard.rule.engine.api.TbContext; |
|
|
|
import org.thingsboard.rule.engine.api.TbNodeConfiguration; |
|
|
|
@ -70,14 +71,18 @@ public class TbGetTelemetryNodeTest { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Test(expected = IllegalArgumentException.class) |
|
|
|
@Test |
|
|
|
public void givenAggregationWhiteSpace_whenParseAggregation_thenException() { |
|
|
|
node.parseAggregationConfig(" "); |
|
|
|
Assertions.assertThrows(IllegalArgumentException.class, () -> { |
|
|
|
node.parseAggregationConfig(" "); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
@Test(expected = IllegalArgumentException.class) |
|
|
|
@Test |
|
|
|
public void givenAggregationIncorrect_whenParseAggregation_thenException() { |
|
|
|
node.parseAggregationConfig("TOP"); |
|
|
|
Assertions.assertThrows(IllegalArgumentException.class, () -> { |
|
|
|
node.parseAggregationConfig("TOP"); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|