MuleArtifactJsonValidator { protected static void checkName(MuleApplicationModel muleArtifact, List<String> missingFields) { String nameValue = muleArtifact.getName(); if (StringUtils.isBlank(nameValue)) { missingFields.add("name"); } }  static void validate(Path projectBaseDir, Optional<String> deployMuleVersion); static void isMuleArtifactJsonPresent(Path projectBaseDir); static void isMuleArtifactJsonValid(Path projectBaseDir, Optional<String> deployMuleVersion);  }
@Test public void checkNameMissingTest() throws IOException { MuleApplicationModel muleArtifact = new MuleApplicationModelJsonSerializer().deserialize("{}"); checkName(muleArtifact, missingFields); assertThat("Missing fields should contain the name field name", missingFields, containsInAnyOrder("name")); }
@Test public void checkNameTest() throws IOException { MuleApplicationModel muleArtifact = new MuleApplicationModelJsonSerializer().deserialize("{ name:aaa }"); checkName(muleArtifact, missingFields); assertThat("Missing fields should be empty", missingFields.isEmpty(), is(true)); }