use of com.epam.ta.reportportal.entity.widget.WidgetOptions in project service-api by reportportal.
the class LaunchExecutionAndIssueStatisticsContentValidatorTest method testValidateWithException.
@Test
public void testValidateWithException() {
Exception exception = assertThrows(ReportPortalException.class, () -> {
HashMap<Filter, Sort> filterSortMap = new HashMap<>();
filterSortMap.put(Filter.builder().withTarget(Launch.class).withCondition(FilterCondition.builder().eq("id", "1").build()).build(), Sort.unsorted());
launchExecutionAndIssueStatisticsContentValidator.validate(Collections.singletonList("test"), filterSortMap, new WidgetOptions(), 5);
});
String expectedMessage = "Bad content fields format";
String actualMessage = exception.getMessage();
assertTrue(actualMessage.contains(expectedMessage));
}
use of com.epam.ta.reportportal.entity.widget.WidgetOptions in project service-api by reportportal.
the class FlakyCasesTableContentValidatorTest method testValidateWithException.
@Test
public void testValidateWithException() {
Exception exception = assertThrows(ReportPortalException.class, () -> {
flakyCasesTableContentValidator.validate(null, new HashMap<>(), new WidgetOptions(), 5);
});
String expectedMessage = "Unable to load widget content. Widget proprties contains errors: launchNameFilter should be specified for widget.";
String actualMessage = exception.getMessage();
assertTrue(actualMessage.contains(expectedMessage));
}
use of com.epam.ta.reportportal.entity.widget.WidgetOptions in project service-api by reportportal.
the class LaunchesComparisonContentValidatorTest method testValidateWithException.
@Test
public void testValidateWithException() {
Exception exception = assertThrows(ReportPortalException.class, () -> {
HashMap<Filter, Sort> filterSortMap = new HashMap<>();
filterSortMap.put(Filter.builder().withTarget(Launch.class).withCondition(FilterCondition.builder().eq("id", "1").build()).build(), Sort.unsorted());
launchesComparisonContentValidator.validate(Collections.singletonList("test"), filterSortMap, new WidgetOptions(), 5);
});
String expectedMessage = "Bad content fields format";
String actualMessage = exception.getMessage();
assertTrue(actualMessage.contains(expectedMessage));
}
use of com.epam.ta.reportportal.entity.widget.WidgetOptions in project service-api by reportportal.
the class ComponentHealthCheckContentValidatorTest method testValidateWithException.
@Test
public void testValidateWithException() {
WidgetOptions widgetOptions = new WidgetOptions(getWidgetOptionsContentWithBlankKey());
Exception exception = assertThrows(ReportPortalException.class, () -> сomponentHealthCheckContentValidator.validate(Collections.singletonList("test"), new HashMap<>(), widgetOptions, new String[] { "v1" }, new HashMap<>(), 100));
String expectedMessage = "Current level key should be not blank";
String actualMessage = exception.getMessage();
assertTrue(actualMessage.contains(expectedMessage));
WidgetOptions wo = new WidgetOptions(getWidgetOptionsContent());
сomponentHealthCheckContentValidator.validate(Collections.singletonList("test"), new HashMap<>(), wo, new String[] { "v1" }, new HashMap<>(), 100);
}
use of com.epam.ta.reportportal.entity.widget.WidgetOptions in project service-api by reportportal.
the class ActivityContentValidatorTest method testValidateWithException.
@Test
public void testValidateWithException() {
Exception exception = assertThrows(ReportPortalException.class, () -> {
activityContentValidator.validate(Collections.singletonList("test"), new HashMap<>(), new WidgetOptions(), 5);
});
String expectedMessage = "Filter-Sort mapping should not be empty";
String actualMessage = exception.getMessage();
assertTrue(actualMessage.contains(expectedMessage));
}
Aggregations