use of com.redhat.devtools.intellij.tektoncd.utils.WatchHandler in project intellij-tekton by redhat-developer.
the class TektonTreeStructureTest method before.
@Before
public void before() throws Exception {
this.project = mock(Project.class);
this.structure = mock(TektonTreeStructure.class, org.mockito.Mockito.CALLS_REAL_METHODS);
this.root = spy(new TektonRootNode(project));
this.tkn = mock(Tkn.class);
when(root.getTkn()).thenReturn(tkn);
this.parent = new NamespaceNode(root, "parent");
Field rootField = TektonTreeStructure.class.getDeclaredField("root");
rootField.setAccessible(true);
rootField.set(structure, root);
config = createConfig("cluster", "namespace", "token", "user");
Field configField = TektonTreeStructure.class.getDeclaredField("config");
configField.setAccessible(true);
configField.set(structure, config);
this.configWatcher = mock(ConfigWatcher.class);
this.tknCliFactory = mock(TknCliFactory.class);
this.metadata1 = new ObjectMeta();
this.metadata1.setName("test1");
this.metadata2 = new ObjectMeta();
this.metadata2.setName("test2");
this.metadata3 = new ObjectMeta();
this.metadata3.setName("test3");
this.watchHandler = mock(WatchHandler.class);
when(tkn.getWatchHandler()).thenReturn(watchHandler);
when(watchHandler.canBeWatched(any())).thenReturn(false);
}
Aggregations