@PluginResponseInspector

Applies to ReadyAPI 3.51, last modified on March 21, 2024

Response Inspector creates a custom Response Inspector tab, which is used to view or edit aspects of a request. It is displayed as a tab in the response editor.

Generally, this extension is combined with custom RequestFilter or RequestTransport to define specific aspects of a response.

The inspectorId property defines the name of the inspector.

The annotated class must implement the EditorInspector interface.

Sample Response Inspector

package com.smartbear.ready.plugin.template.factories;

import com.eviware.soapui.model.ModelItem;
import com.eviware.soapui.plugins.auto.PluginResponseInspector;
import com.eviware.soapui.support.editor.Editor;
import com.eviware.soapui.support.editor.EditorView;
import com.eviware.soapui.support.editor.inspectors.AbstractXmlInspector;
import com.eviware.soapui.support.editor.xml.XmlDocument;

import javax.swing.JComponent;
import javax.swing.JLabel;

/**
*
*/

@PluginResponseInspector(inspectorId = "SampleResponseInspector")
public class SampleResponseInspector extends AbstractXmlInspector {
private ModelItem modelItem;

public SampleResponseInspector(Editor<?> editor, ModelItem modelItem) {
super("Sample Response Inspector", "A sample response inspector", true, "SampleResponseInspector");
this.modelItem = modelItem;
}

@Override
public boolean isEnabledFor(EditorView<XmlDocument> view) {
return true;
}

@Override
public JComponent getComponent() {
return new JLabel(modelItem.getName() + ": " + modelItem.getDescription());
}
}
Highlight search results