diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/APIVersionsIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/APIVersionsIT.java index da719ee11f9..0b411b43de6 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/APIVersionsIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/APIVersionsIT.java @@ -40,7 +40,8 @@ void testApiVersions() { .asInstanceOf(InstanceOfAssertFactories.list(ServerAddressByClientCIDR.class)) .singleElement() .hasFieldOrPropertyWithValue("clientCIDR", "0.0.0.0/0") - .hasFieldOrPropertyWithValue("serverAddress", - String.format("%s:%d", client.getMasterUrl().getHost(), client.getMasterUrl().getPort())); + .extracting("serverAddress") + .asString() + .isNotBlank(); } } diff --git a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PluralizeIT.java b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PluralizeIT.java index 45d5a98931f..0135be16e1f 100644 --- a/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PluralizeIT.java +++ b/kubernetes-itests/src/test/java/io/fabric8/kubernetes/PluralizeIT.java @@ -29,6 +29,7 @@ import org.junit.jupiter.params.provider.MethodSource; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.stream.Stream; @@ -39,6 +40,10 @@ @RequireK8sVersionAtLeast(majorVersion = 1, minorVersion = 16) class PluralizeIT { + // This might be a mistake in OpenShift Aggregated Discovery API, + // The resource kind is ResourceAccessReview, and it's singularName is set as localresourceaccessreview + private static final String[] EXCEPTIONAL_SINGULAR_NAME = new String[] { "localresourceaccessreview" }; + @DisplayName("toPlural, should return argument's plural") @ParameterizedTest(name = "{index} {0}: ''{1}'' plural is ''{2}''") @MethodSource("toPluralInput") @@ -66,7 +71,9 @@ static Stream toPluralInput() { .map(ar -> arguments( ar.getKind(), // So far singularName field is always blank, we fall back to lower-cased kind - Utils.isNullOrEmpty(ar.getSingularName()) ? ar.getKind().toLowerCase(Locale.ROOT) : ar.getSingularName(), + Utils.isNullOrEmpty(ar.getSingularName()) || Arrays.asList(EXCEPTIONAL_SINGULAR_NAME).contains(ar.getSingularName()) + ? ar.getKind().toLowerCase(Locale.ROOT) + : ar.getSingularName(), ar.getName())); } }