@Test void testResourceParameters() throws Exception { SystemParameters testedClass = createSystemParameters(false); Resource resourceOne = Resource.createV3() .setName("first"); Resource resourceTwo = Resource.createV3() .setName("second"); DeploymentDescriptor descriptor = DeploymentDescriptor.createV3() .setResources(List.of(resourceOne, resourceTwo)); testedClass.injectInto(descriptor); for (Resource resource : descriptor.getResources()) { verifyResourceParameters(resource.getName(), resource.getParameters()); } }
public void injectInto(DeploymentDescriptor descriptor) { for (Module module : descriptor.getModules()) { Map<String, Object> moduleSystemParameters = getModuleParameters(module); module.setParameters(MapUtil.merge(moduleSystemParameters, module.getParameters())); } for (Resource resource : descriptor.getResources()) { Map<String, Object> resourceSystemParameters = getResourceParameters(resource); resource.setParameters(MapUtil.merge(resourceSystemParameters, resource.getParameters())); } Map<String, Object> generalSystemParameters = getGeneralParameters(); descriptor.setParameters(MapUtil.merge(generalSystemParameters, descriptor.getParameters())); }
SystemParameters { public void injectInto(DeploymentDescriptor descriptor) { for (Module module : descriptor.getModules()) { Map<String, Object> moduleSystemParameters = getModuleParameters(module); module.setParameters(MapUtil.merge(moduleSystemParameters, module.getParameters())); } for (Resource resource : descriptor.getResources()) { Map<String, Object> resourceSystemParameters = getResourceParameters(resource); resource.setParameters(MapUtil.merge(resourceSystemParameters, resource.getParameters())); } Map<String, Object> generalSystemParameters = getGeneralParameters(); descriptor.setParameters(MapUtil.merge(generalSystemParameters, descriptor.getParameters())); } }
SystemParameters { public void injectInto(DeploymentDescriptor descriptor) { for (Module module : descriptor.getModules()) { Map<String, Object> moduleSystemParameters = getModuleParameters(module); module.setParameters(MapUtil.merge(moduleSystemParameters, module.getParameters())); } for (Resource resource : descriptor.getResources()) { Map<String, Object> resourceSystemParameters = getResourceParameters(resource); resource.setParameters(MapUtil.merge(resourceSystemParameters, resource.getParameters())); } Map<String, Object> generalSystemParameters = getGeneralParameters(); descriptor.setParameters(MapUtil.merge(generalSystemParameters, descriptor.getParameters())); } SystemParameters(Builder builder); }
SystemParameters { public void injectInto(DeploymentDescriptor descriptor) { for (Module module : descriptor.getModules()) { Map<String, Object> moduleSystemParameters = getModuleParameters(module); module.setParameters(MapUtil.merge(moduleSystemParameters, module.getParameters())); } for (Resource resource : descriptor.getResources()) { Map<String, Object> resourceSystemParameters = getResourceParameters(resource); resource.setParameters(MapUtil.merge(resourceSystemParameters, resource.getParameters())); } Map<String, Object> generalSystemParameters = getGeneralParameters(); descriptor.setParameters(MapUtil.merge(generalSystemParameters, descriptor.getParameters())); } SystemParameters(Builder builder); void injectInto(DeploymentDescriptor descriptor); }
SystemParameters { public void injectInto(DeploymentDescriptor descriptor) { for (Module module : descriptor.getModules()) { Map<String, Object> moduleSystemParameters = getModuleParameters(module); module.setParameters(MapUtil.merge(moduleSystemParameters, module.getParameters())); } for (Resource resource : descriptor.getResources()) { Map<String, Object> resourceSystemParameters = getResourceParameters(resource); resource.setParameters(MapUtil.merge(resourceSystemParameters, resource.getParameters())); } Map<String, Object> generalSystemParameters = getGeneralParameters(); descriptor.setParameters(MapUtil.merge(generalSystemParameters, descriptor.getParameters())); } SystemParameters(Builder builder); void injectInto(DeploymentDescriptor descriptor); static final int GENERATED_CREDENTIALS_LENGTH; static final String IDLE_HOST_SUFFIX; static final String ROUTE_PATH_PLACEHOLDER; static final String DEFAULT_HOST_BASED_IDLE_URI; static final String DEFAULT_HOST_BASED_URI; static final String DEFAULT_IDLE_URL; static final String DEFAULT_URL; }