use of io.fabric8.openclustermanagement.api.model.cluster.v1alpha1.PlacementBuilder in project kubernetes-client by fabric8io.
the class PlacementTest method builderShouldCreateObject.
@Test
void builderShouldCreateObject() {
// Given
PlacementBuilder placementBuilder = new PlacementBuilder().withNewMetadata().withName("placement1").withNamespace("ns1").endMetadata().withNewSpec().addNewPredicate().withNewRequiredClusterSelector().withNewLabelSelector().addToMatchLabels("vendor", "OpenShift").endLabelSelector().endRequiredClusterSelector().endPredicate().endSpec();
// When
Placement placement = placementBuilder.build();
// Then
assertNotNull(placement);
assertEquals("placement1", placement.getMetadata().getName());
assertEquals(1, placement.getSpec().getPredicates().size());
assertEquals("OpenShift", placement.getSpec().getPredicates().get(0).getRequiredClusterSelector().getLabelSelector().getMatchLabels().get("vendor"));
}
Aggregations