|
7 | 7 |
|
8 | 8 | public class CustomResourceUtilsTest {
|
9 | 9 | @Test
|
10 |
| - public void assertNamespacedCustomResource() { |
11 |
| - var clusterCrd = TestUtils.testCRD("Cluster"); |
| 10 | + public void assertClusterCustomResourceIsCluster() { |
| 11 | + var crd = TestUtils.testCRD("Cluster"); |
12 | 12 |
|
13 |
| - CustomResourceUtils.assertCustomResource(TestCustomResource.class, clusterCrd); |
| 13 | + CustomResourceUtils.assertCustomResource(TestCustomResource.class, crd); |
| 14 | + } |
| 15 | + |
| 16 | + @Test |
| 17 | + public void assertClusterCustomResourceNotNamespaced() { |
| 18 | + var crd = TestUtils.testCRD("Cluster"); |
14 | 19 |
|
15 | 20 | Assertions.assertThrows(
|
16 | 21 | OperatorException.class,
|
17 |
| - () -> |
18 |
| - CustomResourceUtils.assertCustomResource( |
19 |
| - NamespacedTestCustomResource.class, clusterCrd)); |
| 22 | + () -> CustomResourceUtils.assertCustomResource(NamespacedTestCustomResource.class, crd)); |
| 23 | + } |
| 24 | + |
| 25 | + @Test |
| 26 | + public void assertNamespacedCustomResourceIsNamespaced() { |
| 27 | + var crd = TestUtils.testCRD("Namespaced"); |
20 | 28 |
|
21 |
| - var namespacedCrd = TestUtils.testCRD("Namespaced"); |
| 29 | + CustomResourceUtils.assertCustomResource(NamespacedTestCustomResource.class, crd); |
| 30 | + } |
| 31 | + |
| 32 | + @Test |
| 33 | + public void assertNamespacedCustomResourceNotCluster() { |
| 34 | + var crd = TestUtils.testCRD("Namespaced"); |
22 | 35 |
|
23 | 36 | Assertions.assertThrows(
|
24 | 37 | OperatorException.class,
|
25 |
| - () -> CustomResourceUtils.assertCustomResource(TestCustomResource.class, namespacedCrd)); |
26 |
| - |
27 |
| - CustomResourceUtils.assertCustomResource(NamespacedTestCustomResource.class, namespacedCrd); |
| 38 | + () -> CustomResourceUtils.assertCustomResource(TestCustomResource.class, crd)); |
28 | 39 | }
|
29 | 40 | }
|
0 commit comments