@Before @SuppressWarnings("unchecked") public void setup() { this.check = spy(getRule()); when(context.getGraph()).thenReturn(graph); when(context.getConnector()).thenReturn(connector); when(connector.getContent()).thenReturn(connectorView); when(connectorView.getDefinition()).thenReturn(new Definition()); }
@Before @SuppressWarnings("unchecked") public void setup() throws Exception { super.setup(); this.graph = graphHandler.graph; when(graphHandler.definitionAdapter.getId(eq(connectorDef))).thenReturn(DefinitionId.build(DEF_EDGE_ID)); this.connector = graphHandler.newEdge(EDGE_UUID, Optional.of(connectorDef)); when(connectionContext.getGraph()).thenReturn(graph); when(connectionContext.getConnector()).thenReturn(connector); when(ruleExtension.getId()).thenReturn(DEF_EDGE_ID); when(ruleExtension.getArguments()).thenReturn(new String[]{"violation1"}); tested = new ConnectorParentsMatchConnectionHandler(graphHandler.definitionManager); }