use of com.epam.ta.reportportal.entity.item.TestItem in project commons-dao by reportportal.
the class LogRepositoryTest method findLogMessagesByItemIdAndLogLevelNestedTest.
@Sql("/db/fill/item/items-with-nested-steps.sql")
@Test
void findLogMessagesByItemIdAndLogLevelNestedTest() {
TestItem testItem = testItemRepository.findById(132L).get();
List<String> messagesByItemIdAndLevelGte = logRepository.findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(testItem.getLaunchId(), testItem.getItemId(), testItem.getPath(), LogLevel.ERROR.toInt());
assertTrue(CollectionUtils.isNotEmpty(messagesByItemIdAndLevelGte));
assertEquals(1, messagesByItemIdAndLevelGte.size());
assertEquals("java.lang.NullPointerException: Oops\n" + "\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + "\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" + "\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + "\tat java.base/java.lang.reflect.Method.invoke(Method.java:566)\n", messagesByItemIdAndLevelGte.get(0));
}
use of com.epam.ta.reportportal.entity.item.TestItem in project commons-dao by reportportal.
the class LogRepositoryTest method findLogMessagesByItemIdAndLoLevelGteTest.
@Test
void findLogMessagesByItemIdAndLoLevelGteTest() {
TestItem testItem = testItemRepository.findById(3L).get();
List<String> messagesByItemIdAndLevelGte = logRepository.findMessagesByLaunchIdAndItemIdAndPathAndLevelGte(testItem.getLaunchId(), testItem.getItemId(), testItem.getPath(), LogLevel.WARN.toInt());
assertTrue(CollectionUtils.isNotEmpty(messagesByItemIdAndLevelGte));
assertEquals(7, messagesByItemIdAndLevelGte.size());
messagesByItemIdAndLevelGte.forEach(it -> assertEquals("log", it));
}
use of com.epam.ta.reportportal.entity.item.TestItem in project commons-dao by reportportal.
the class CreateLogAttachmentServiceTest method getLogWithoutAttachment.
private Log getLogWithoutAttachment() {
Log log = new Log();
log.setId(1L);
log.setLaunch(new Launch(2L));
log.setTestItem(new TestItem(3L));
log.setLogLevel(4000);
log.setLogMessage("message");
log.setLogTime(LocalDateTime.now());
return log;
}
use of com.epam.ta.reportportal.entity.item.TestItem in project commons-dao by reportportal.
the class ItemAttributeTest method getAttribute.
private ItemAttribute getAttribute(Long id, String key, String value, boolean system, Long launchId, Long itemId) {
ItemAttribute attr = new ItemAttribute();
attr.setId(id);
attr.setKey(key);
attr.setValue(value);
attr.setSystem(system);
if (launchId != null) {
Launch launch = new Launch();
launch.setId(launchId);
attr.setLaunch(launch);
}
if (itemId != null) {
TestItem item = new TestItem();
item.setItemId(itemId);
attr.setTestItem(item);
}
return attr;
}
Aggregations