@Test void testWriteNonSoapService_NofolderCreated(final TemporaryFolder temporaryFolder) { SoapResourceWriter writer = new SoapResourceWriter(DocumentFileUtils.INSTANCE); Bundle bundle = new Bundle(); bundle.addEntity(ROOT_FOLDER); bundle.setFolderTree(new FolderTree(bundle.getEntities(Folder.class).values())); Service service = new Service(); service.setName(NAME_SERVICE); service.setParentFolder(ROOT_FOLDER); service.setPolicy(POLICY_XML); bundle.getServices().put("service", service); writer.write(bundle, temporaryFolder.getRoot(), bundle); File wsdlFolder = new File(temporaryFolder.getRoot(), SOAP_RESOURCES_FOLDER); assertFalse(wsdlFolder.exists()); File serviceSoapResourcesFolder = new File(wsdlFolder, NAME_SERVICE); assertFalse(serviceSoapResourcesFolder.exists()); File wsdlFile = new File(serviceSoapResourcesFolder, WSDL_FILE_NAME); assertFalse(wsdlFile.exists()); }
@Override public void write(Bundle bundle, File rootFolder, Bundle rawBundle) { Map<String, Service> services = bundle.getEntities(Service.class); services.values().stream().filter(s -> isNotEmpty(s.getSoapResources())).forEach(serviceEntity -> serviceEntity.getSoapResources().forEach(resource -> writeSoapResource(bundle, rootFolder, serviceEntity.getParentFolder().getId(), serviceEntity.getName(), resource) )); }
SoapResourceWriter implements EntityWriter { @Override public void write(Bundle bundle, File rootFolder, Bundle rawBundle) { Map<String, Service> services = bundle.getEntities(Service.class); services.values().stream().filter(s -> isNotEmpty(s.getSoapResources())).forEach(serviceEntity -> serviceEntity.getSoapResources().forEach(resource -> writeSoapResource(bundle, rootFolder, serviceEntity.getParentFolder().getId(), serviceEntity.getName(), resource) )); } }
SoapResourceWriter implements EntityWriter { @Override public void write(Bundle bundle, File rootFolder, Bundle rawBundle) { Map<String, Service> services = bundle.getEntities(Service.class); services.values().stream().filter(s -> isNotEmpty(s.getSoapResources())).forEach(serviceEntity -> serviceEntity.getSoapResources().forEach(resource -> writeSoapResource(bundle, rootFolder, serviceEntity.getParentFolder().getId(), serviceEntity.getName(), resource) )); } @Inject  SoapResourceWriter(DocumentFileUtils documentFileUtils); }
SoapResourceWriter implements EntityWriter { @Override public void write(Bundle bundle, File rootFolder, Bundle rawBundle) { Map<String, Service> services = bundle.getEntities(Service.class); services.values().stream().filter(s -> isNotEmpty(s.getSoapResources())).forEach(serviceEntity -> serviceEntity.getSoapResources().forEach(resource -> writeSoapResource(bundle, rootFolder, serviceEntity.getParentFolder().getId(), serviceEntity.getName(), resource) )); } @Inject  SoapResourceWriter(DocumentFileUtils documentFileUtils); @Override void write(Bundle bundle, File rootFolder, Bundle rawBundle); }
SoapResourceWriter implements EntityWriter { @Override public void write(Bundle bundle, File rootFolder, Bundle rawBundle) { Map<String, Service> services = bundle.getEntities(Service.class); services.values().stream().filter(s -> isNotEmpty(s.getSoapResources())).forEach(serviceEntity -> serviceEntity.getSoapResources().forEach(resource -> writeSoapResource(bundle, rootFolder, serviceEntity.getParentFolder().getId(), serviceEntity.getName(), resource) )); } @Inject  SoapResourceWriter(DocumentFileUtils documentFileUtils); @Override void write(Bundle bundle, File rootFolder, Bundle rawBundle);  }