This repository was archived by the owner on Feb 13, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
main/java/io/skodjob/testframe/clients/cmdClient
test/java/io/skodjob/testframe/clients/cmdClient Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,13 +46,21 @@ public interface KubeCmdClient<K extends KubeCmdClient<K>> {
4646
4747
4848 /**
49- * Sets the timeout for subsequent operations.
49+ * Sets the timeout for later operations.
5050 *
51- * @param timeout timeout for execution of command.
51+ * @param timeout timeout in ms for execution of command.
5252 * @return This kube client.
5353 */
5454 KubeCmdClient <K > withTimeout (int timeout );
5555
56+ /**
57+ * Sets the timeout for later operations.
58+ *
59+ * @param timeout timeout in ms for execution of command.
60+ * @return This kube client.
61+ */
62+ KubeCmdClient <K > withTimeout (long timeout );
63+
5664 /**
5765 * Retrieves the currently set namespace for the Kubernetes client.
5866 *
Original file line number Diff line number Diff line change @@ -59,6 +59,17 @@ public Kubectl withTimeout(int timeout) {
5959 return new Kubectl (namespace , config , timeout );
6060 }
6161
62+ /**
63+ * Sets the timeout for subsequent operations.
64+ *
65+ * @param timeout timeout for execution of command.
66+ * @return This kube client.
67+ */
68+ @ Override
69+ public Kubectl withTimeout (long timeout ) {
70+ return new Kubectl (namespace , config , (int ) timeout );
71+ }
72+
6273 /**
6374 * Gets the current namespace of the Kubectl instance.
6475 *
Original file line number Diff line number Diff line change @@ -62,16 +62,27 @@ public Oc inNamespace(String namespace) {
6262 }
6363
6464 /**
65- * Sets the timeout for subsequent operations.
65+ * Sets the timeout for later operations.
6666 *
67- * @param timeout timeout for execution of command.
67+ * @param timeout timeout in ms for execution of command.
6868 * @return This kube client.
6969 */
7070 @ Override
7171 public Oc withTimeout (int timeout ) {
7272 return new Oc (namespace , config , timeout );
7373 }
7474
75+ /**
76+ * Sets the timeout for later operations.
77+ *
78+ * @param timeout timeout in ms for execution of command.
79+ * @return This kube client.
80+ */
81+ @ Override
82+ public Oc withTimeout (long timeout ) {
83+ return new Oc (namespace , config , (int ) timeout );
84+ }
85+
7586 /**
7687 * Gets the current namespace of the Oc instance.
7788 *
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ void testGetUsernameConstructsCommandAndReturnsOutput() {
110110 ExecResult mockResult = mockSuccessfulExecResult (expectedUsername );
111111 mockedExec .when (() -> Exec .exec (anyList (), eq (10 ))).thenReturn (mockResult );
112112
113- Kubectl client = new Kubectl (CUSTOM_CONFIG ).inNamespace (DEFAULT_NAMESPACE ).withTimeout (10 );
113+ Kubectl client = new Kubectl (CUSTOM_CONFIG ).inNamespace (DEFAULT_NAMESPACE ).withTimeout (10L );
114114 String actualUsername = client .getUsername ();
115115
116116 assertEquals (expectedUsername , actualUsername );
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ void testNewAppConstructsCorrectCommand() {
132132 ExecResult mockResult = mockSuccessfulExecResult ("Application created" );
133133 mockedExec .when (() -> Exec .exec (anyList (), eq (5 ))).thenReturn (mockResult );
134134
135- Oc client = new Oc (CUSTOM_CONFIG ).inNamespace (DEFAULT_NAMESPACE ).withTimeout (5 );
135+ Oc client = new Oc (CUSTOM_CONFIG ).inNamespace (DEFAULT_NAMESPACE ).withTimeout (5L );
136136 client .newApp (templateName , params );
137137
138138 ArgumentCaptor <List <String >> listCaptor = ArgumentCaptor .forClass (List .class );
Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ public KubeCmdClient<TestableCmdKubeClient> withTimeout(int timeout) {
3232 return null ;
3333 }
3434
35+ @ Override
36+ public KubeCmdClient <TestableCmdKubeClient > withTimeout (long timeout ) {
37+ return null ;
38+ }
39+
3540 @ Override
3641 public String getCurrentNamespace () {
3742 return "" ;
You can’t perform that action at this time.
0 commit comments