Search in sources :

Example 1 with MapViewManager

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));
}
Also used : SelectionManager(org.opennms.features.topology.api.SelectionManager) BoundingBox(org.opennms.features.topology.api.BoundingBox) MapViewManager(org.opennms.features.topology.api.MapViewManager) CategoryHopCriteria(org.opennms.features.topology.app.internal.support.CategoryHopCriteria) SearchCriteria(org.opennms.features.topology.api.topo.SearchCriteria) Criteria(org.opennms.features.topology.api.topo.Criteria) IpLikeHopCriteria(org.opennms.features.topology.app.internal.support.IpLikeHopCriteria) AlarmHopCriteria(org.opennms.features.topology.app.internal.support.AlarmHopCriteria) VertexRef(org.opennms.features.topology.api.topo.VertexRef) CircleLayoutAlgorithm(org.opennms.features.topology.app.internal.jung.CircleLayoutAlgorithm)

Aggregations

BoundingBox (org.opennms.features.topology.api.BoundingBox)1 MapViewManager (org.opennms.features.topology.api.MapViewManager)1 SelectionManager (org.opennms.features.topology.api.SelectionManager)1 Criteria (org.opennms.features.topology.api.topo.Criteria)1 SearchCriteria (org.opennms.features.topology.api.topo.SearchCriteria)1 VertexRef (org.opennms.features.topology.api.topo.VertexRef)1 CircleLayoutAlgorithm (org.opennms.features.topology.app.internal.jung.CircleLayoutAlgorithm)1 AlarmHopCriteria (org.opennms.features.topology.app.internal.support.AlarmHopCriteria)1 CategoryHopCriteria (org.opennms.features.topology.app.internal.support.CategoryHopCriteria)1 IpLikeHopCriteria (org.opennms.features.topology.app.internal.support.IpLikeHopCriteria)1