Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
adina-hub committed Dec 19, 2024
1 parent 0f5b632 commit ab2c4c9
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion packages/nodes-base/credentials/VerticaApi.credentials.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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://<server>:<port>/v1/',
};

properties: INodeProperties[] = [
{
displayName: 'URL',
name: 'url',
required: true,
type: 'string',
default: 'https://localhost:8443',
placeholder: 'https://<server>:<port>',
},
{
displayName: 'Username',
name: 'username',
Expand All @@ -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',
},
},
],
};
}

0 comments on commit ab2c4c9

Please sign in to comment.