use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta in project yakc by manusa.
the class NetworkingV1IngressIT method patchNamespacedIngress.
@Test
@DisplayName("patchNamespacedIngress, should patch labels of Ingress")
void patchNamespacedIngress() throws IOException {
// Given
final Ingress patch = Ingress.builder().metadata(ObjectMeta.builder().putInLabels("patched-label", "1337").build()).build();
// When
final Ingress result = KC.create(NetworkingV1Api.class).patchNamespacedIngress(ingressName, NAMESPACE, patch).get();
// Then
assertThat(result).isNotNull().extracting(Ingress::getMetadata).satisfies(m -> assertThat(m).extracting(ObjectMeta::getLabels).asInstanceOf(InstanceOfAssertFactories.MAP).hasSize(1).containsEntry("patched-label", "1337")).extracting(ObjectMeta::getResourceVersion).asString().isNotEmpty().isNotEqualTo(ingress.getMetadata().getResourceVersion());
}
Aggregations