use of org.entando.kubernetes.model.common.EntandoCustomResource in project entando-k8s-controller-coordinator by entando-k8s.
the class CoordinatorTestUtils method toSerializedResource.
@SuppressWarnings("unchecked")
public static SerializedEntandoResource toSerializedResource(EntandoCustomResource entandoCustomResource) {
try {
final ObjectMapper objectMapper = new ObjectMapper();
final SerializedEntandoResource result = objectMapper.readValue(objectMapper.writeValueAsString(entandoCustomResource), SerializedEntandoResource.class);
result.setDefinition(CustomResourceDefinitionContext.fromCustomResourceType((Class<? extends CustomResource<?, ?>>) entandoCustomResource.getClass()));
return result;
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
Aggregations