use of com.epam.ta.reportportal.database.entity.Log in project commons-dao by reportportal.
the class LogRepositoryTest method findModifiedLaterAgo.
@Test
public void findModifiedLaterAgo() {
final Log log = new Log();
logRepository.save(log);
List<Log> logs = mongoTemplate.find(findModifiedLaterThanPeriod(Duration.ofHours(-26)), Log.class);
Assert.assertTrue(logs.size() == 2);
Assert.assertTrue(logs.contains(saved));
}
use of com.epam.ta.reportportal.database.entity.Log in project commons-dao by reportportal.
the class LogRepositoryTest method addLogWithBinaryData.
@Before
public void addLogWithBinaryData() {
Map<String, String> metaInfo = new HashMap<>();
metaInfo.put("project", "EPMRPP");
BinaryData binaryData = new BinaryData(CONTENT_TYPE, 64807L, this.getClass().getClassLoader().getResourceAsStream("meh.jpg"));
filename = dataStorage.saveData(binaryData, "filename", metaInfo);
thumbnail = dataStorage.saveData(binaryData, "thumbnail", metaInfo);
BinaryContent binaryContent = new BinaryContent(filename, thumbnail, CONTENT_TYPE);
Log log = new Log();
log.setBinaryContent(binaryContent);
saved = logRepository.save(log);
}
use of com.epam.ta.reportportal.database.entity.Log in project commons-dao by reportportal.
the class LogRepositoryTest method logs.
public List<Log> logs() {
Log log1 = new Log();
log1.setTestItemRef("item1");
log1.setBinaryContent(new BinaryContent("binary1", "thumbnail1", "contentType1"));
Log log2 = new Log();
log2.setTestItemRef("item1");
log2.setBinaryContent(new BinaryContent("binary2", "thumbnail2", "contentType2"));
Log log3 = new Log();
log3.setTestItemRef("item2");
log3.setBinaryContent(new BinaryContent("binary3", "thumbnail3", "contentType3"));
return asList(log1, log2, log3);
}
use of com.epam.ta.reportportal.database.entity.Log in project commons-dao by reportportal.
the class LogRepositoryTest method deleteByItemRef.
@Test
public void deleteByItemRef() {
final String itemRef = "itemRef";
final Log log = new Log();
log.setTestItemRef(itemRef);
logRepository.save(log);
logRepository.deleteByItemRef(singletonList(itemRef));
Assert.assertFalse(logRepository.exists(log.getId()));
}
Aggregations