Search in sources :

Example 1 with TknCliFactory

use of com.redhat.devtools.intellij.tektoncd.tkn.TknCliFactory in project intellij-tekton by redhat-developer.

the class TektonTreeStructureTest method OnUpdate_NamespaceHasBeenChanged_Refresh.

@Test
public void OnUpdate_NamespaceHasBeenChanged_Refresh() {
    Config newConfig = createConfig("cluster", "changed", "token", "user");
    try (MockedStatic<TknCliFactory> tknCliFactoryMockedStatic = mockStatic(TknCliFactory.class)) {
        tknCliFactoryMockedStatic.when(() -> TknCliFactory.getInstance()).thenReturn(tknCliFactory);
        structure.onUpdate(configWatcher, newConfig);
        verify(structure, times(1)).refresh();
    }
}
Also used : Config(io.fabric8.kubernetes.api.model.Config) TknCliFactory(com.redhat.devtools.intellij.tektoncd.tkn.TknCliFactory) Test(org.junit.Test)

Example 2 with TknCliFactory

use of com.redhat.devtools.intellij.tektoncd.tkn.TknCliFactory in project intellij-tekton by redhat-developer.

the class TektonTreeStructureTest method OnUpdate_TokenHasBeenChanged_Refresh.

@Test
public void OnUpdate_TokenHasBeenChanged_Refresh() {
    Config newConfig = createConfig("cluster", "namespace", "changed", "user");
    try (MockedStatic<TknCliFactory> tknCliFactoryMockedStatic = mockStatic(TknCliFactory.class)) {
        tknCliFactoryMockedStatic.when(() -> TknCliFactory.getInstance()).thenReturn(tknCliFactory);
        structure.onUpdate(configWatcher, newConfig);
        verify(structure, times(1)).refresh();
    }
}
Also used : Config(io.fabric8.kubernetes.api.model.Config) TknCliFactory(com.redhat.devtools.intellij.tektoncd.tkn.TknCliFactory) Test(org.junit.Test)

Example 3 with TknCliFactory

use of com.redhat.devtools.intellij.tektoncd.tkn.TknCliFactory in project intellij-tekton by redhat-developer.

the class TektonTreeStructureTest method OnUpdate_ClusterHasBeenChanged_Refresh.

@Test
public void OnUpdate_ClusterHasBeenChanged_Refresh() {
    Config newConfig = createConfig("changed", "namespace", "token", "user");
    try (MockedStatic<TknCliFactory> tknCliFactoryMockedStatic = mockStatic(TknCliFactory.class)) {
        tknCliFactoryMockedStatic.when(() -> TknCliFactory.getInstance()).thenReturn(tknCliFactory);
        structure.onUpdate(configWatcher, newConfig);
        verify(structure, times(1)).refresh();
    }
}
Also used : Config(io.fabric8.kubernetes.api.model.Config) TknCliFactory(com.redhat.devtools.intellij.tektoncd.tkn.TknCliFactory) Test(org.junit.Test)

Example 4 with TknCliFactory

use of com.redhat.devtools.intellij.tektoncd.tkn.TknCliFactory in project intellij-tekton by redhat-developer.

the class TektonTreeStructureTest method OnUpdate_UserHasBeenChanged_Refresh.

@Test
public void OnUpdate_UserHasBeenChanged_Refresh() {
    Config newConfig = createConfig("cluster", "namespace", "token", "changed");
    try (MockedStatic<TknCliFactory> tknCliFactoryMockedStatic = mockStatic(TknCliFactory.class)) {
        tknCliFactoryMockedStatic.when(() -> TknCliFactory.getInstance()).thenReturn(tknCliFactory);
        structure.onUpdate(configWatcher, newConfig);
        verify(structure, times(1)).refresh();
    }
}
Also used : Config(io.fabric8.kubernetes.api.model.Config) TknCliFactory(com.redhat.devtools.intellij.tektoncd.tkn.TknCliFactory) Test(org.junit.Test)

Aggregations

TknCliFactory (com.redhat.devtools.intellij.tektoncd.tkn.TknCliFactory)4 Config (io.fabric8.kubernetes.api.model.Config)4 Test (org.junit.Test)4