Browse Source

junit5: UUIDConverterTest annotation exceptions refactoring

pull/8174/head
Oleksandra Matviienko 3 years ago
parent
commit
888f026fd6
  1. 7
      common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java

7
common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java

@ -18,6 +18,7 @@ package org.thingsboard.server.common.data;
import com.datastax.oss.driver.api.core.uuid.Uuids;
import org.junit.Assert;
import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
@ -58,9 +59,11 @@ public class UUIDConverterTest {
Assert.assertEquals(UUID.fromString("58e0a7d7-eebc-11d8-9669-0800200c9a66"), result);
}
@Test(expected = IllegalArgumentException.class)
@Test
public void nonV1UuidToStringTest() {
UUIDConverter.fromTimeUUID(UUID.fromString("58e0a7d7-eebc-01d8-9669-0800200c9a66"));
Assertions.assertThrows(IllegalArgumentException.class, () -> {
UUIDConverter.fromTimeUUID(UUID.fromString("58e0a7d7-eebc-01d8-9669-0800200c9a66"));
});
}
@Test

Loading…
Cancel
Save