DefaultValuesMuleArtifactJsonGenerator extends AbstractDefaultValuesMuleArtifactJsonGenerator { @Override protected void setBuilderWithDefaultExportedPackagesValue(MuleApplicationModel.MuleApplicationModelBuilder builder, MuleApplicationModel originalMuleArtifact, MuleArtifactContentResolver muleArtifactContentResolver) throws IOException { MuleArtifactLoaderDescriptor descriptorLoader = builder.getClassLoaderModelDescriptorLoader(); Map<String, Object> attributesCopy = getUpdatedAttributes(descriptorLoader, EXPORTED_PACKAGES, muleArtifactContentResolver.getExportedPackages()); builder.withClassLoaderModelDescriptorLoader(new MuleArtifactLoaderDescriptor(descriptorLoader.getId(), attributesCopy)); }   static final String EXPORTED_PACKAGES; static final String EXPORTED_RESOURCES; static final String DEFAULT_PACKAGE_EXPORT; static final String COMPILED_JAVA_EXTENSION; static final String PACKAGE_SEPARATOR; }
@Test public void setBuilderWithDefaultExportedPackagesValueTest() throws IOException { MuleArtifactContentResolver resolverMock = mock(MuleArtifactContentResolver.class); List<String> exportedPackages = new ArrayList<>(); exportedPackages.add(JAR_1); exportedPackages.add(JAR_2); exportedPackages.add(JAR_3); when(resolverMock.getExportedPackages()).thenReturn(exportedPackages); generator.setBuilderWithDefaultExportedPackagesValue(defaultBuilder, muleArtifact, resolverMock); assertThat("Exported packages are not the expected", defaultBuilder.build().getClassLoaderModelLoaderDescriptor().getAttributes().get("exportedPackages"), equalTo(exportedPackages)); }