Search in sources :

Example 1 with KubeClusterResource

use of io.strimzi.test.k8s.KubeClusterResource in project strimzi by strimzi.

the class StrimziRunner method clusterResource.

/**
 * Get the value of the @ClassRule-annotated KubeClusterResource field
 */
private KubeClusterResource clusterResource() {
    if (clusterResource == null) {
        List<KubeClusterResource> fieldValues = getTestClass().getAnnotatedFieldValues(null, ClassRule.class, KubeClusterResource.class);
        if (fieldValues == null || fieldValues.isEmpty()) {
            fieldValues = getTestClass().getAnnotatedMethodValues(null, ClassRule.class, KubeClusterResource.class);
        }
        if (fieldValues == null || fieldValues.isEmpty()) {
            clusterResource = new KubeClusterResource();
            clusterResource.before();
        } else {
            clusterResource = fieldValues.get(0);
        }
    }
    return clusterResource;
}
Also used : ClassRule(org.junit.ClassRule) KubeClusterResource(io.strimzi.test.k8s.KubeClusterResource)

Aggregations

KubeClusterResource (io.strimzi.test.k8s.KubeClusterResource)1 ClassRule (org.junit.ClassRule)1