Quarkus kubernetesMockServer for application initialization
The problem is that the Mock Server is only configured to respond right before the test execution, while this code:
void OnStart(@Observes StartupEvent ev) { KubernetesClient oc = new DefaultKubernetesClient(); CustomResourceDefinition crd = oc.customResourceDefinitions() .list().getItems().stream() .filter( ob -> ob.getMetadata().getName().equals("types.openshift.example-cloud.com")) .findFirst().get(); LOGGER.info("Using {}", crd.getMetadata().getName()); }
runs when the application is actually comes up (which is before any @BeforeEach
runs).
Can you please open an issue on the Quarkus Github? This should be something we provide a solution for