test fixes and minor refactoring

This commit is contained in:
YevhenBondarenko 2023-12-26 11:08:06 +01:00
parent feb44656f1
commit 1fc704bae1
5 changed files with 7 additions and 12 deletions

View File

@ -27,7 +27,7 @@ import org.springframework.stereotype.Component;
import org.thingsboard.common.util.ThingsBoardThreadFactory;
import jakarta.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import jakarta.annotation.PreDestroy;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.concurrent.Executors;

View File

@ -832,4 +832,4 @@ class TbDateTest {
Assert.assertNotNull(serializedTbDate);
Assert.assertEquals(expectedDate.toString(), serializedTbDate);
}
}
}

View File

@ -1971,11 +1971,6 @@
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency>
<dependency>
<groupId>io.hypersistence</groupId>
<artifactId>hypersistence-utils-hibernate-55</artifactId>
<version>${hypersistence-utils.version}</version>
</dependency>
<dependency>
<groupId>io.hypersistence</groupId>
<artifactId>hypersistence-utils-hibernate-62</artifactId>

View File

@ -393,4 +393,4 @@ public class TbHttpClient {
}
}
}
}

View File

@ -211,7 +211,7 @@ public class TbDeviceProfileNodeTest {
registerCreateAlarmMock(alarmService.updateAlarm(any()), false);
Thread.sleep(1);
TbMsg msg2 = TbMsg.newMsg(TbMsgType.POST_TELEMETRY_REQUEST, deviceId, TbMsgMetaData.EMPTY,
TbMsgDataType.JSON, JacksonUtil.toString(data), null, null);
node.onMsg(ctx, msg2);
@ -644,7 +644,7 @@ public class TbDeviceProfileNodeTest {
verify(ctx, Mockito.never()).tellNext(theMsg, "Alarm Created");
Thread.sleep(halfOfAlarmDelay);
Thread.sleep(halfOfAlarmDelay + 1);
TbMsg msg2 = TbMsg.newMsg(TbMsgType.POST_TELEMETRY_REQUEST, deviceId, TbMsgMetaData.EMPTY,
TbMsgDataType.JSON, JacksonUtil.toString(data), null, null);
@ -768,7 +768,7 @@ public class TbDeviceProfileNodeTest {
verify(ctx, Mockito.never()).tellNext(theMsg, "Alarm Created");
Thread.sleep(halfOfAlarmDelay);
Thread.sleep(halfOfAlarmDelay + 1);
TbMsg msg2 = TbMsg.newMsg(TbMsgType.POST_TELEMETRY_REQUEST, deviceId, TbMsgMetaData.EMPTY,
TbMsgDataType.JSON, JacksonUtil.toString(data), null, null);
@ -1089,7 +1089,7 @@ public class TbDeviceProfileNodeTest {
verify(ctx, Mockito.never()).tellNext(theMsg, "Alarm Created");
Thread.sleep(halfOfAlarmDelay);
Thread.sleep(halfOfAlarmDelay + 1);
TbMsg msg2 = TbMsg.newMsg(TbMsgType.POST_TELEMETRY_REQUEST, deviceId, TbMsgMetaData.EMPTY,
TbMsgDataType.JSON, JacksonUtil.toString(data), null, null);