@Test public void testUpdateMetaDataCallsSuccessor() { final String updatedMetaData = "{\"updated\":\"meta-data\"}"; final String resourceName = "update-my-meta-data.txt"; ResourceIdentifier notMeResourceIdentifier = new ResourceIdentifier.Builder().setResourceName(resourceName).setGroupName("not-a-web-app").build(); groupAppResourceHandler.updateResourceMetaData(notMeResourceIdentifier, resourceName, updatedMetaData); verify(mockSuccessor).updateResourceMetaData(eq(notMeResourceIdentifier), eq(resourceName), eq(updatedMetaData)); }
@Override public String updateResourceMetaData(final ResourceIdentifier resourceIdentifier, final String resourceName, final String metaData) { if (canHandle(resourceIdentifier)) { final String previousMetaData = groupPersistenceService.getGroupAppResourceTemplateMetaData(resourceIdentifier.groupName, resourceName, resourceIdentifier.webAppName); final String updatedMetaData = groupPersistenceService.updateGroupAppResourceMetaData(resourceIdentifier.groupName, resourceIdentifier.webAppName, resourceName, metaData); updateApplicationUnpackWar(resourceIdentifier.webAppName, resourceName, metaData); updateMetaDataForChildJVMResources(resourceIdentifier, resourceName, metaData); updateAppTemplatesWhenDeployToJvmsChanged(resourceIdentifier, resourceName, previousMetaData, updatedMetaData); return updatedMetaData; } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } }
GroupLevelAppResourceHandler extends ResourceHandler { @Override public String updateResourceMetaData(final ResourceIdentifier resourceIdentifier, final String resourceName, final String metaData) { if (canHandle(resourceIdentifier)) { final String previousMetaData = groupPersistenceService.getGroupAppResourceTemplateMetaData(resourceIdentifier.groupName, resourceName, resourceIdentifier.webAppName); final String updatedMetaData = groupPersistenceService.updateGroupAppResourceMetaData(resourceIdentifier.groupName, resourceIdentifier.webAppName, resourceName, metaData); updateApplicationUnpackWar(resourceIdentifier.webAppName, resourceName, metaData); updateMetaDataForChildJVMResources(resourceIdentifier, resourceName, metaData); updateAppTemplatesWhenDeployToJvmsChanged(resourceIdentifier, resourceName, previousMetaData, updatedMetaData); return updatedMetaData; } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } } }
GroupLevelAppResourceHandler extends ResourceHandler { @Override public String updateResourceMetaData(final ResourceIdentifier resourceIdentifier, final String resourceName, final String metaData) { if (canHandle(resourceIdentifier)) { final String previousMetaData = groupPersistenceService.getGroupAppResourceTemplateMetaData(resourceIdentifier.groupName, resourceName, resourceIdentifier.webAppName); final String updatedMetaData = groupPersistenceService.updateGroupAppResourceMetaData(resourceIdentifier.groupName, resourceIdentifier.webAppName, resourceName, metaData); updateApplicationUnpackWar(resourceIdentifier.webAppName, resourceName, metaData); updateMetaDataForChildJVMResources(resourceIdentifier, resourceName, metaData); updateAppTemplatesWhenDeployToJvmsChanged(resourceIdentifier, resourceName, previousMetaData, updatedMetaData); return updatedMetaData; } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } } GroupLevelAppResourceHandler(final ResourceDao resourceDao,
                                        final GroupPersistenceService groupPersistenceService,
                                        final JvmPersistenceService jvmPersistenceService,
                                        final ApplicationPersistenceService applicationPersistenceService,
                                        final ResourceHandler successor); }
GroupLevelAppResourceHandler extends ResourceHandler { @Override public String updateResourceMetaData(final ResourceIdentifier resourceIdentifier, final String resourceName, final String metaData) { if (canHandle(resourceIdentifier)) { final String previousMetaData = groupPersistenceService.getGroupAppResourceTemplateMetaData(resourceIdentifier.groupName, resourceName, resourceIdentifier.webAppName); final String updatedMetaData = groupPersistenceService.updateGroupAppResourceMetaData(resourceIdentifier.groupName, resourceIdentifier.webAppName, resourceName, metaData); updateApplicationUnpackWar(resourceIdentifier.webAppName, resourceName, metaData); updateMetaDataForChildJVMResources(resourceIdentifier, resourceName, metaData); updateAppTemplatesWhenDeployToJvmsChanged(resourceIdentifier, resourceName, previousMetaData, updatedMetaData); return updatedMetaData; } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } } GroupLevelAppResourceHandler(final ResourceDao resourceDao,
                                        final GroupPersistenceService groupPersistenceService,
                                        final JvmPersistenceService jvmPersistenceService,
                                        final ApplicationPersistenceService applicationPersistenceService,
                                        final ResourceHandler successor); @Override ConfigTemplate fetchResource(final ResourceIdentifier resourceIdentifier); @Override CreateResourceResponseWrapper createResource(final ResourceIdentifier resourceIdentifier,
                   final ResourceTemplateMetaData metaData,
                   final String templateContent); @Override void deleteResource(final ResourceIdentifier resourceIdentifier); @Override String updateResourceMetaData(final ResourceIdentifier resourceIdentifier, final String resourceName, final String metaData); @Override Object getSelectedValue(ResourceIdentifier resourceIdentifier); @Override List<String> getResourceNames(ResourceIdentifier resourceIdentifier); }
GroupLevelAppResourceHandler extends ResourceHandler { @Override public String updateResourceMetaData(final ResourceIdentifier resourceIdentifier, final String resourceName, final String metaData) { if (canHandle(resourceIdentifier)) { final String previousMetaData = groupPersistenceService.getGroupAppResourceTemplateMetaData(resourceIdentifier.groupName, resourceName, resourceIdentifier.webAppName); final String updatedMetaData = groupPersistenceService.updateGroupAppResourceMetaData(resourceIdentifier.groupName, resourceIdentifier.webAppName, resourceName, metaData); updateApplicationUnpackWar(resourceIdentifier.webAppName, resourceName, metaData); updateMetaDataForChildJVMResources(resourceIdentifier, resourceName, metaData); updateAppTemplatesWhenDeployToJvmsChanged(resourceIdentifier, resourceName, previousMetaData, updatedMetaData); return updatedMetaData; } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } } GroupLevelAppResourceHandler(final ResourceDao resourceDao,
                                        final GroupPersistenceService groupPersistenceService,
                                        final JvmPersistenceService jvmPersistenceService,
                                        final ApplicationPersistenceService applicationPersistenceService,
                                        final ResourceHandler successor); @Override ConfigTemplate fetchResource(final ResourceIdentifier resourceIdentifier); @Override CreateResourceResponseWrapper createResource(final ResourceIdentifier resourceIdentifier,
                   final ResourceTemplateMetaData metaData,
                   final String templateContent); @Override void deleteResource(final ResourceIdentifier resourceIdentifier); @Override String updateResourceMetaData(final ResourceIdentifier resourceIdentifier, final String resourceName, final String metaData); @Override Object getSelectedValue(ResourceIdentifier resourceIdentifier); @Override List<String> getResourceNames(ResourceIdentifier resourceIdentifier);  }