use of com.epam.ta.reportportal.ws.model.Position in project service-api by reportportal.
the class DashboardControllerTest method addWidget.
@Test
void addWidget() throws Exception {
AddWidgetRq rq = new AddWidgetRq();
rq.setAddWidget(new DashboardResource.WidgetObjectModel("kek", 10L, new Size(5, 5), new Position(0, 0)));
mockMvc.perform(put(DEFAULT_PROJECT_BASE_URL + "/dashboard/17/add").with(token(oAuthHelper.getDefaultToken())).contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(rq))).andExpect(status().isOk());
}
use of com.epam.ta.reportportal.ws.model.Position in project service-api by reportportal.
the class WidgetConverterTest method getWidgetObjectModel.
private static DashboardResource.WidgetObjectModel getWidgetObjectModel() {
final DashboardResource.WidgetObjectModel widgetObjectModel = new DashboardResource.WidgetObjectModel();
widgetObjectModel.setWidgetId(1L);
widgetObjectModel.setWidgetPosition(new Position(3, 5));
widgetObjectModel.setWidgetSize(new Size(4, 8));
return widgetObjectModel;
}
use of com.epam.ta.reportportal.ws.model.Position in project service-api by reportportal.
the class DashboardBuilderTest method updateDashboard.
@Test
void updateDashboard() {
final String name = "name";
final String description = "description";
final boolean share = true;
UpdateDashboardRQ updateDashboardRQ = new UpdateDashboardRQ();
updateDashboardRQ.setName(name);
updateDashboardRQ.setDescription(description);
updateDashboardRQ.setShare(share);
updateDashboardRQ.setWidgets(Collections.singletonList(new DashboardResource.WidgetObjectModel("kek", 1L, new Size(10, 20), new Position(30, 40))));
DashboardWidget dashboardWidget = new DashboardWidget();
dashboardWidget.setHeight(5);
dashboardWidget.setWidth(10);
dashboardWidget.setPositionX(1);
dashboardWidget.setPositionY(2);
dashboardWidget.setId(new DashboardWidgetId(1L, 1L));
final Dashboard existDashboard = new Dashboard();
existDashboard.addWidget(dashboardWidget);
final Dashboard dashboard = new DashboardBuilder(existDashboard).addUpdateRq(updateDashboardRQ).get();
assertEquals(name, dashboard.getName());
assertEquals(description, dashboard.getDescription());
assertEquals(share, dashboard.isShared());
}
Aggregations