use of org.opennms.features.topology.api.MapViewManager in project opennms by OpenNMS.
the class BundleContextHistoryManagerTest method setBehaviour.
private void setBehaviour(GraphContainer graphContainerMock) {
MapViewManager mapViewManagerMock = Mockito.mock(MapViewManager.class);
SelectionManager selectionManagerMock = Mockito.mock(SelectionManager.class);
Mockito.when(mapViewManagerMock.getCurrentBoundingBox()).thenReturn(new BoundingBox(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE));
Mockito.when(selectionManagerMock.getSelectedVertexRefs()).thenReturn(new ArrayList<VertexRef>());
Mockito.when(graphContainerMock.getGraph()).thenReturn(graphMock);
Mockito.when(graphContainerMock.getSemanticZoomLevel()).thenReturn(0);
Mockito.when(graphContainerMock.getLayoutAlgorithm()).thenReturn(new CircleLayoutAlgorithm());
Mockito.when(graphContainerMock.getMapViewManager()).thenReturn(mapViewManagerMock);
Mockito.when(graphContainerMock.getSelectionManager()).thenReturn(selectionManagerMock);
Mockito.when(graphContainerMock.getTopologyServiceClient()).thenReturn(topologyServiceClientMock);
Mockito.doAnswer(invocationOnMock -> capturedCriteria.toArray(new Criteria[capturedCriteria.size()])).when(graphContainerMock).getCriteria();
Mockito.doAnswer(invocationOnMock -> {
capturedCriteria.clear();
return null;
}).when(graphContainerMock).clearCriteria();
Mockito.doAnswer(invocation -> {
if (invocation.getArguments()[0] != null && invocation.getArguments()[0] instanceof Criteria) {
capturedCriteria.add((Criteria) invocation.getArguments()[0]);
}
return null;
}).when(graphContainerMock).addCriteria(Matchers.any(Criteria.class));
}
Aggregations