use of au.gov.asd.tac.constellation.plugins.PluginExecution in project constellation by constellation-app.
the class ActiveTableReferenceNGTest method updateVisibleColumnsAdd.
@Test
public void updateVisibleColumnsAdd() {
try (MockedStatic<PluginExecution> pluginExecutionMockedStatic = Mockito.mockStatic(PluginExecution.class)) {
final Graph graph = mock(Graph.class);
final Attribute attribute = mock(Attribute.class);
final PluginExecution pluginExecution = mock(PluginExecution.class);
final List<Tuple<String, Attribute>> paramColumnAttributes = List.of(Tuple.create("paramAttr", attribute));
final List<Tuple<String, Attribute>> stateColumnAttributes = List.of(Tuple.create("stateAttr", attribute), Tuple.create("paramAttr", attribute));
final TableViewState tableViewState = new TableViewState();
tableViewState.setColumnAttributes(stateColumnAttributes);
pluginExecutionMockedStatic.when(() -> PluginExecution.withPlugin(any(Plugin.class))).thenAnswer(executeUpdateStatePlugin(pluginExecution, tableViewState, List.of(Tuple.create("stateAttr", attribute), Tuple.create("paramAttr", attribute), Tuple.create("paramAttr", attribute))));
activeTableReference.updateVisibleColumns(graph, tableViewState, paramColumnAttributes, UpdateMethod.ADD);
verify(pluginExecution).executeLater(graph);
}
}
use of au.gov.asd.tac.constellation.plugins.PluginExecution in project constellation by constellation-app.
the class ActiveTableReferenceNGTest method updateVisibleColumnsReplace.
@Test
public void updateVisibleColumnsReplace() {
try (MockedStatic<PluginExecution> pluginExecutionMockedStatic = Mockito.mockStatic(PluginExecution.class)) {
final Graph graph = mock(Graph.class);
final Attribute attribute = mock(Attribute.class);
final PluginExecution pluginExecution = mock(PluginExecution.class);
final List<Tuple<String, Attribute>> paramColumnAttributes = List.of(Tuple.create("paramAttr", attribute));
final List<Tuple<String, Attribute>> stateColumnAttributes = List.of(Tuple.create("stateAttr1", attribute), Tuple.create("stateAttr2", attribute));
final TableViewState tableViewState = new TableViewState();
tableViewState.setColumnAttributes(stateColumnAttributes);
pluginExecutionMockedStatic.when(() -> PluginExecution.withPlugin(any(Plugin.class))).thenAnswer(executeUpdateStatePlugin(pluginExecution, tableViewState, List.of(Tuple.create("paramAttr", attribute))));
activeTableReference.updateVisibleColumns(graph, tableViewState, paramColumnAttributes, UpdateMethod.REPLACE);
verify(pluginExecution).executeLater(graph);
}
}
Aggregations