From ab2c4c92a6c4ff7bd89617199c7c957a3e70774a Mon Sep 17 00:00:00 2001 From: Adina Totorean Date: Thu, 19 Dec 2024 13:53:11 +0200 Subject: [PATCH] Added test --- .../credentials/VerticaApi.credentials.ts | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/credentials/VerticaApi.credentials.ts b/packages/nodes-base/credentials/VerticaApi.credentials.ts index 212409fca9b9c..f79ca4f0e6560 100644 --- a/packages/nodes-base/credentials/VerticaApi.credentials.ts +++ b/packages/nodes-base/credentials/VerticaApi.credentials.ts @@ -1,4 +1,9 @@ -import type { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow'; +import type { + IAuthenticateGeneric, + ICredentialTestRequest, + ICredentialType, + INodeProperties, +} from 'n8n-workflow'; export class VerticaApi implements ICredentialType { name = 'verticaApi'; @@ -7,7 +12,21 @@ export class VerticaApi implements ICredentialType { documentationUrl = 'https://docs.vertica.com/24.4.x/en/'; + httpRequestNode = { + name: 'Vertica', + docsUrl: 'https://docs.vertica.com/24.4.x/en/', + apiBaseUrlPlaceholder: 'http://:/v1/', + }; + properties: INodeProperties[] = [ + { + displayName: 'URL', + name: 'url', + required: true, + type: 'string', + default: 'https://localhost:8443', + placeholder: 'https://:', + }, { displayName: 'Username', name: 'username', @@ -34,4 +53,22 @@ export class VerticaApi implements ICredentialType { }, }, }; + + test: ICredentialTestRequest = { + request: { + baseURL: '={{$credentials.url}}'.replace(/\/$/, ''), + url: '/v1/nodes', + method: 'GET', + skipSslCertificateValidation: true, + }, + rules: [ + { + type: 'responseCode', + properties: { + value: 403, + message: 'Connection failed: Invalid credentials or unreachable server', + }, + }, + ], + }; }