diff --git a/pom.xml b/pom.xml index 8f36ce0..7fe7189 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.blazemeter jmeter-bzm-correlation-recorder jar - 2.1 + 2.2 Correlation Recorder as JMeter plugin Correlation Recorder Plugin for JMeter https://github.com/Blazemeter/CorrelationRecorder @@ -160,6 +160,17 @@ 1.9 test + + org.apache.maven + maven-artifact + 3.8.4 + + + org.apache.commons + commons-lang3 + 3.12.0 + provided + diff --git a/src/main/java/com/blazemeter/jmeter/correlation/CorrelationProxyControl.java b/src/main/java/com/blazemeter/jmeter/correlation/CorrelationProxyControl.java index bb4837e..9e7c7d3 100644 --- a/src/main/java/com/blazemeter/jmeter/correlation/CorrelationProxyControl.java +++ b/src/main/java/com/blazemeter/jmeter/correlation/CorrelationProxyControl.java @@ -18,13 +18,11 @@ import com.blazemeter.jmeter.correlation.core.templates.ConfigurationException; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplateDependency; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplateVersions; -import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRegistry; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRegistryHandler; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRepositoriesConfiguration; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRepositoriesRegistryHandler; import com.blazemeter.jmeter.correlation.core.templates.CorrelationTemplatesRepository; import com.blazemeter.jmeter.correlation.core.templates.LocalConfiguration; -import com.blazemeter.jmeter.correlation.core.templates.LocalCorrelationTemplatesRegistry; import com.blazemeter.jmeter.correlation.core.templates.Template; import com.blazemeter.jmeter.correlation.core.templates.Template.Builder; import com.blazemeter.jmeter.correlation.core.templates.repository.RepositoryManager; @@ -115,7 +113,6 @@ public class CorrelationProxyControl extends ProxyControl implements private transient CorrelationTemplatesRepositoriesConfiguration templateRepositoryConfig; private transient LocalConfiguration localConfiguration; private transient CorrelationEngine correlationEngine; - private transient CorrelationTemplatesRegistry correlationTemplatesRegistry; private JMeterTreeNode target = null; private List samples = new ArrayList<>(); private Method putSamplesIntoModel; @@ -136,7 +133,6 @@ public CorrelationProxyControl() { correlationEngine = new CorrelationEngine(); componentsRegistry = CorrelationComponentsRegistry.getInstance(); localConfiguration = new LocalConfiguration(JMeterUtils.getJMeterBinDir()); - correlationTemplatesRegistry = new LocalCorrelationTemplatesRegistry(localConfiguration); templateRepositoryConfig = new CorrelationTemplatesRepositoriesConfiguration(localConfiguration); setName(RECORDER_NAME); @@ -147,14 +143,12 @@ public CorrelationProxyControl( CorrelationComponentsRegistry componentsRegistry, CorrelationTemplatesRepositoriesConfiguration templateRepositoryConfig, LocalConfiguration localConfiguration, - CorrelationEngine correlationEngine, - CorrelationTemplatesRegistry correlationTemplatesRegistry) { + CorrelationEngine correlationEngine) { this.componentsRegistry = componentsRegistry; this.templateRepositoryConfig = templateRepositoryConfig; this.localConfiguration = localConfiguration; this.correlationEngine = correlationEngine; - this.correlationTemplatesRegistry = correlationTemplatesRegistry; } public CorrelationTemplatesRepositoriesConfiguration getTemplateRepositoryConfig() { @@ -519,9 +513,7 @@ public void onSaveTemplate(Builder builder) throws IOException, ConfigurationExc .withResponseFilters(getResponseFilter()) .build(); - correlationTemplatesRegistry.save(template); - updateLocalRepository(template); - installTemplate(template.getRepositoryId(), template.getId(), template.getVersion()); + localConfiguration.saveTemplate(template); } public List getGroups() { @@ -578,16 +570,12 @@ public void setResponseFilter(String responseFilter) { setProperty(RESPONSE_FILTER, responseFilter); } - private void updateLocalRepository(Template template) { - templateRepositoryConfig - .updateLocalRepository(template.getId(), template.getVersion()); - } - @Override public void onLoadTemplate(String repositoryOwner, String id, String templateVersion) throws IOException { - Optional