Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions apps/server-nestjs/src/modules/healthz/healthz.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { DatabaseHealthService } from '../../cpin-module/infrastructure/database
import { ArgoCDHealthService } from '../argocd/argocd-health.service'
import { GitlabHealthService } from '../gitlab/gitlab-health.service'
import { KeycloakHealthService } from '../keycloak/keycloak-health.service'
import { NexusHealthService } from '../nexus/nexus-health.service'
import { RegistryHealthService } from '../registry/registry-health.service'
import { VaultHealthService } from '../vault/vault-health.service'

@Controller('api/v1/healthz')
Expand All @@ -14,6 +16,8 @@ export class HealthzController {
@Inject(KeycloakHealthService) private readonly keycloak: KeycloakHealthService,
@Inject(GitlabHealthService) private readonly gitlab: GitlabHealthService,
@Inject(VaultHealthService) private readonly vault: VaultHealthService,
@Inject(NexusHealthService) private readonly nexus: NexusHealthService,
@Inject(RegistryHealthService) private readonly registry: RegistryHealthService,
@Inject(ArgoCDHealthService) private readonly argocd: ArgoCDHealthService,
) {}

Expand All @@ -25,6 +29,8 @@ export class HealthzController {
() => this.keycloak.check('keycloak'),
() => this.gitlab.check('gitlab'),
() => this.vault.check('vault'),
() => this.nexus.check('nexus'),
() => this.registry.check('registry'),
() => this.argocd.check('argocd'),
])
}
Expand Down
4 changes: 4 additions & 0 deletions apps/server-nestjs/src/modules/healthz/healthz.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { DatabaseModule } from '../../cpin-module/infrastructure/database/databa
import { ArgoCDModule } from '../argocd/argocd.module'
import { GitlabModule } from '../gitlab/gitlab.module'
import { KeycloakModule } from '../keycloak/keycloak.module'
import { NexusModule } from '../nexus/nexus.module'
import { RegistryModule } from '../registry/registry.module'
import { VaultModule } from '../vault/vault.module'
import { HealthzController } from './healthz.controller'

Expand All @@ -14,6 +16,8 @@ import { HealthzController } from './healthz.controller'
KeycloakModule,
GitlabModule,
VaultModule,
NexusModule,
RegistryModule,
ArgoCDModule,
],
controllers: [HealthzController],
Expand Down
33 changes: 33 additions & 0 deletions apps/server-nestjs/src/modules/nexus/nexus-client.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type { TestingModule } from '@nestjs/testing'
import { Test } from '@nestjs/testing'
import { beforeEach, describe, expect, it } from 'vitest'
import { ConfigurationService } from '../../cpin-module/infrastructure/configuration/configuration.service'
import { NexusClientService } from './nexus-client.service'

function createNexusServiceTestingModule() {
return Test.createTestingModule({
providers: [
NexusClientService,
{
provide: ConfigurationService,
useValue: {
nexusSecretExposedUrl: 'https://nexus.example',
projectRootPath: 'forge',
} satisfies Partial<ConfigurationService>,
},
],
})
}

describe('nexusClientService', () => {
let service: NexusClientService

beforeEach(async () => {
const module: TestingModule = await createNexusServiceTestingModule().compile()
service = module.get(NexusClientService)
})

it('should be defined', () => {
expect(service).toBeDefined()
})
})
Loading
Loading