use of org.parosproxy.paros.model.Model in project zaproxy by zaproxy.
the class SessionStructure method find.
/**
* Finds the node in the Site tree for the given request data
*
* @param sessionId the session id
* @param uri the URI
* @param method the method
* @param postData the POST data
* @return the site node or null if not found
* @throws DatabaseException
* @throws URIException
* @depreciated Use {@link #find(Model, URI, String, String)}
*/
@Deprecated
public static StructuralNode find(long sessionId, URI uri, String method, String postData) throws DatabaseException, URIException {
Model model = Model.getSingleton();
if (!Constant.isLowMemoryOptionSet()) {
SiteNode node = model.getSession().getSiteTree().findNode(uri, method, postData);
if (node == null) {
return null;
}
return new StructuralSiteNode(node);
}
String nodeName = getNodeName(model, uri, method, postData);
RecordStructure rs = model.getDb().getTableStructure().find(sessionId, nodeName, method);
if (rs == null) {
return null;
}
return new StructuralTableNode(rs);
}
use of org.parosproxy.paros.model.Model in project zaproxy by zaproxy.
the class WithConfigsTest method setUpZap.
/**
* Sets up ZAP, by initialising the home/installation dirs and core classes (for example, {@link
* Constant}, {@link Control}, {@link Model}).
*
* @throws Exception if an error occurred while setting up the dirs or core classes.
*/
@BeforeEach
void setUpZap() throws Exception {
Constant.setZapInstall(zapInstallDir);
Constant.setZapHome(zapHomeDir);
model = mock(Model.class, withSettings().defaultAnswer(CALLS_REAL_METHODS));
Model.setSingletonForTesting(model);
extensionLoader = mock(ExtensionLoader.class, withSettings().lenient());
// Init all the things
Constant.getInstance();
setUpConstantMessages();
Control.initSingletonForTesting(Model.getSingleton(), extensionLoader);
Model.getSingleton().getOptionsParam().load(new ZapXmlConfiguration());
}
Aggregations