Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
gyfora merged PR #1068: URL: https://github.com/apache/flink-kubernetes-operator/pull/1068 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
atpugtihsrah commented on PR #1068: URL: https://github.com/apache/flink-kubernetes-operator/pull/1068#issuecomment-4207465292 @gyfora Thanks for triggering the CI. Fixed the build. Could you please re-trigger the CI again? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
atpugtihsrah commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2994352332
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus;
+import
org.apache.flink.kubernetes.operator.api.status.JobManagerDeploymentStatus;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null.
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2993570157
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,200 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import org.apache.flink.api.common.JobStatus;
+import org.apache.flink.kubernetes.operator.api.status.FlinkDeploymentStatus;
+import
org.apache.flink.kubernetes.operator.api.status.JobManagerDeploymentStatus;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null.
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
atpugtihsrah commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2918287407
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2897007766
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2896996005
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
atpugtihsrah commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2896965815
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
atpugtihsrah commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2896863071
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2895027611
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2895023359
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2895023359
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
atpugtihsrah commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2895016779
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2894998209
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2894998209
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,169 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+private static Stream updateLastTransitionTimeParams() {
+String existingConditionLastTransitionTime = Instant.now().toString();
+
+return Stream.of(
+// Test Null
+Arguments.of(Collections.emptyList(), null, null, true),
+
+// Test Empty Conditions
+Arguments.of(
+Collections.emptyList(),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+false),
+
+// Test Correct Update
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+"lastTransitionTime", "message", 0L, "reason",
"status", "type"),
+true),
+
+// Test Status Unchanged
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type")),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status",
+"type"),
+true),
+
+// Test Status Changed
+Arguments.of(
+List.of(
+new Condition(
+existingConditionLastTransitionTime,
+"message",
+0L,
+"reason",
+"status1",
+
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
atpugtihsrah commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2894935162
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.api.Test;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+@Test
+void testNull_UpdateLastTransitionTime() {
Review Comment:
Apologies, I pushed but forgot to add the changes in the commit message 😅
Please try now.
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.api.Test;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+@Test
+void testNull_UpdateLastTransitionTime() {
Review Comment:
Apologies, I pushed but forgot to add the changes in the commit 😅 Please try
now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2894887892
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.api.Test;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+@Test
+void testNull_UpdateLastTransitionTime() {
Review Comment:
I do not see the new code - did you put it up? fyi I was thinking of
something like [this](
https://github.com/apache/flink-connector-http/blob/2991fdf619bec7ee091f0f1ed13b8df851670253/flink-connector-http/src/test/java/org/apache/flink/connector/http/table/lookup/HttpLookupTableSourceTest.java#L258)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
davidradl commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2894887892
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.api.Test;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+@Test
+void testNull_UpdateLastTransitionTime() {
Review Comment:
I do not see the new code - did you put it up? fyi I was thinking of
somehting like [this](
https://github.com/apache/flink-connector-http/blob/2991fdf619bec7ee091f0f1ed13b8df851670253/flink-connector-http/src/test/java/org/apache/flink/connector/http/table/lookup/HttpLookupTableSourceTest.java#L258)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] [FLINK-39220] Add unit tests for ConditionsUtils [flink-kubernetes-operator]
atpugtihsrah commented on code in PR #1068:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/1068#discussion_r2894800230
##
flink-kubernetes-operator-api/src/test/java/org/apache/flink/kubernetes/operator/api/utils/ConditionsUtilsTest.java:
##
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.kubernetes.operator.api.utils;
+
+import io.fabric8.kubernetes.api.model.Condition;
+import org.junit.jupiter.api.Test;
+
+import java.time.Instant;
+import java.util.Collections;
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotEquals;
+
+/** Test for {@link ConditionsUtils}. */
+public class ConditionsUtilsTest {
+
+@Test
+void testNull_UpdateLastTransitionTime() {
Review Comment:
Thanks David for the review and suggestion. I rewrote the tests as
parameterized tests, could you please review again?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
