From d6c087884939d9511809da0203f23f5d86f7cfa6 Mon Sep 17 00:00:00 2001 From: bequinn Date: Wed, 25 Oct 2023 11:03:54 -0400 Subject: [PATCH] Fix file path error in tests --- .../main/java/io/fabric8/crd/generator/CRDGenerationInfo.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crd-generator/api/src/main/java/io/fabric8/crd/generator/CRDGenerationInfo.java b/crd-generator/api/src/main/java/io/fabric8/crd/generator/CRDGenerationInfo.java index 08db83f90b3..8b971a6cf96 100644 --- a/crd-generator/api/src/main/java/io/fabric8/crd/generator/CRDGenerationInfo.java +++ b/crd-generator/api/src/main/java/io/fabric8/crd/generator/CRDGenerationInfo.java @@ -36,8 +36,9 @@ public Map> getCRDDetailsPerNameAndVersion() { } void add(String crdName, String version, URI fileURI) { + String filePath = fileURI.getScheme().equals("mem") ? fileURI.toString() : new File(fileURI).getAbsolutePath(); crdNameToVersionToCRDInfoMap.computeIfAbsent(crdName, k -> new HashMap<>()) - .put(version, new CRDInfo(crdName, version, new File(fileURI).getAbsolutePath(), ClassDependenciesVisitor.getDependentClassesFromCRDName(crdName))); + .put(version, new CRDInfo(crdName, version, filePath, ClassDependenciesVisitor.getDependentClassesFromCRDName(crdName))); } public int numberOfGeneratedCRDs() {