junit5: TbGetTelemetryNodeTest annotation exceptions refactoring

This commit is contained in:
Oleksandra Matviienko 2023-03-06 15:17:57 +01:00
parent 888f026fd6
commit 7327adf239

View File

@ -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");
});
}
}