@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-jvm").build(); jvmResourceHandler.updateResourceMetaData(notMeResourceIdentifier, resourceName, updatedMetaData); verify(mockSuccessor).updateResourceMetaData(eq(notMeResourceIdentifier), eq(resourceName), eq(updatedMetaData)); }
@Override public String updateResourceMetaData(ResourceIdentifier resourceIdentifier, String resourceName, String metaData) { if (canHandle(resourceIdentifier)) { return jvmPersistenceService.updateResourceMetaData(resourceIdentifier.jvmName, resourceName, metaData); } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } }
JvmResourceHandler extends ResourceHandler { @Override public String updateResourceMetaData(ResourceIdentifier resourceIdentifier, String resourceName, String metaData) { if (canHandle(resourceIdentifier)) { return jvmPersistenceService.updateResourceMetaData(resourceIdentifier.jvmName, resourceName, metaData); } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } } }
JvmResourceHandler extends ResourceHandler { @Override public String updateResourceMetaData(ResourceIdentifier resourceIdentifier, String resourceName, String metaData) { if (canHandle(resourceIdentifier)) { return jvmPersistenceService.updateResourceMetaData(resourceIdentifier.jvmName, resourceName, metaData); } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } } JvmResourceHandler(final ResourceDao resourceDao, final GroupPersistenceService groupPersistenceService,
                              final JvmPersistenceService jvmPersistenceService, final ResourceHandler successor); }
JvmResourceHandler extends ResourceHandler { @Override public String updateResourceMetaData(ResourceIdentifier resourceIdentifier, String resourceName, String metaData) { if (canHandle(resourceIdentifier)) { return jvmPersistenceService.updateResourceMetaData(resourceIdentifier.jvmName, resourceName, metaData); } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } } JvmResourceHandler(final ResourceDao resourceDao, final GroupPersistenceService groupPersistenceService,
                              final JvmPersistenceService jvmPersistenceService, 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(ResourceIdentifier resourceIdentifier, String resourceName, String metaData); @Override Object getSelectedValue(ResourceIdentifier resourceIdentifier); @Override List<String> getResourceNames(ResourceIdentifier resourceIdentifier); }
JvmResourceHandler extends ResourceHandler { @Override public String updateResourceMetaData(ResourceIdentifier resourceIdentifier, String resourceName, String metaData) { if (canHandle(resourceIdentifier)) { return jvmPersistenceService.updateResourceMetaData(resourceIdentifier.jvmName, resourceName, metaData); } else { return successor.updateResourceMetaData(resourceIdentifier, resourceName, metaData); } } JvmResourceHandler(final ResourceDao resourceDao, final GroupPersistenceService groupPersistenceService,
                              final JvmPersistenceService jvmPersistenceService, 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(ResourceIdentifier resourceIdentifier, String resourceName, String metaData); @Override Object getSelectedValue(ResourceIdentifier resourceIdentifier); @Override List<String> getResourceNames(ResourceIdentifier resourceIdentifier);  }