@Test public void checkClassLoaderModelDescriptorMissingTest() throws IOException { MuleApplicationModel muleArtifact = new MuleApplicationModelJsonSerializer().deserialize("{ }"); checkClassLoaderModelDescriptor(muleArtifact, missingFields); assertThat("Missing fields should contain the classLoaderModelLoaderDescriptor and classLoaderModelLoaderDescriptor.id fields names", missingFields, containsInAnyOrder("classLoaderModelLoaderDescriptor", "classLoaderModelLoaderDescriptor.id")); }
protected static void checkClassLoaderModelDescriptor(MuleApplicationModel muleArtifact, List<String> missingFields) { MuleArtifactLoaderDescriptor classLoaderModelDescriptor = muleArtifact.getClassLoaderModelLoaderDescriptor(); if (classLoaderModelDescriptor == null) { missingFields.add("classLoaderModelLoaderDescriptor"); } if (classLoaderModelDescriptor == null || StringUtils.isBlank(classLoaderModelDescriptor.getId())) { missingFields.add("classLoaderModelLoaderDescriptor.id"); } }
MuleArtifactJsonValidator { protected static void checkClassLoaderModelDescriptor(MuleApplicationModel muleArtifact, List<String> missingFields) { MuleArtifactLoaderDescriptor classLoaderModelDescriptor = muleArtifact.getClassLoaderModelLoaderDescriptor(); if (classLoaderModelDescriptor == null) { missingFields.add("classLoaderModelLoaderDescriptor"); } if (classLoaderModelDescriptor == null || StringUtils.isBlank(classLoaderModelDescriptor.getId())) { missingFields.add("classLoaderModelLoaderDescriptor.id"); } } }
MuleArtifactJsonValidator { protected static void checkClassLoaderModelDescriptor(MuleApplicationModel muleArtifact, List<String> missingFields) { MuleArtifactLoaderDescriptor classLoaderModelDescriptor = muleArtifact.getClassLoaderModelLoaderDescriptor(); if (classLoaderModelDescriptor == null) { missingFields.add("classLoaderModelLoaderDescriptor"); } if (classLoaderModelDescriptor == null || StringUtils.isBlank(classLoaderModelDescriptor.getId())) { missingFields.add("classLoaderModelLoaderDescriptor.id"); } }  }
MuleArtifactJsonValidator { protected static void checkClassLoaderModelDescriptor(MuleApplicationModel muleArtifact, List<String> missingFields) { MuleArtifactLoaderDescriptor classLoaderModelDescriptor = muleArtifact.getClassLoaderModelLoaderDescriptor(); if (classLoaderModelDescriptor == null) { missingFields.add("classLoaderModelLoaderDescriptor"); } if (classLoaderModelDescriptor == null || StringUtils.isBlank(classLoaderModelDescriptor.getId())) { missingFields.add("classLoaderModelLoaderDescriptor.id"); } }  static void validate(Path projectBaseDir, Optional<String> deployMuleVersion); static void isMuleArtifactJsonPresent(Path projectBaseDir); static void isMuleArtifactJsonValid(Path projectBaseDir, Optional<String> deployMuleVersion); }
MuleArtifactJsonValidator { protected static void checkClassLoaderModelDescriptor(MuleApplicationModel muleArtifact, List<String> missingFields) { MuleArtifactLoaderDescriptor classLoaderModelDescriptor = muleArtifact.getClassLoaderModelLoaderDescriptor(); if (classLoaderModelDescriptor == null) { missingFields.add("classLoaderModelLoaderDescriptor"); } if (classLoaderModelDescriptor == null || StringUtils.isBlank(classLoaderModelDescriptor.getId())) { missingFields.add("classLoaderModelLoaderDescriptor.id"); } }  static void validate(Path projectBaseDir, Optional<String> deployMuleVersion); static void isMuleArtifactJsonPresent(Path projectBaseDir); static void isMuleArtifactJsonValid(Path projectBaseDir, Optional<String> deployMuleVersion);  }