|
1 | | -// src/modules/carts/secondary-adapters/repositories/redis-cart-repository/redis.cart-repository.spec.ts |
| 1 | +// src/modules/carts/secondary-adapters/repositories/cached-cart-repository/cached.cart-repository.spec.ts |
2 | 2 | import { Test, TestingModule } from '@nestjs/testing'; |
3 | 3 | import { CartRepository } from '../../../core/domain/repositories/cart.repository'; |
4 | 4 | import { CacheService } from '../../../../../infrastructure/redis/cache/cache.service'; |
5 | 5 | import { Result } from '../../../../../shared-kernel/domain/result'; |
6 | 6 | import { RepositoryError } from '../../../../../shared-kernel/domain/exceptions/repository.error'; |
7 | 7 | import { CART_REDIS } from '../../../../../infrastructure/redis/constants/redis.constants'; |
8 | | -import { RedisCartRepository } from './redis.cart-repository'; |
| 8 | +import { CachedCartRepository } from './cached.cart-repository'; |
9 | 9 | import { Cart } from '../../../core/domain/entities/cart'; |
10 | 10 | import { CartTestFactory } from '../../../testing/factories/cart.factory'; |
11 | 11 | import { CartCacheMapper } from '../../persistence/mappers/cart.mapper'; |
12 | 12 | import { ResultAssertionHelper } from '../../../../../testing'; |
13 | 13 | import { Logger } from '@nestjs/common'; |
14 | 14 |
|
15 | | -describe('RedisCartRepository', () => { |
16 | | - let repository: RedisCartRepository; |
| 15 | +describe('CachedCartRepository', () => { |
| 16 | + let repository: CachedCartRepository; |
17 | 17 | let cacheService: jest.Mocked<CacheService>; |
18 | 18 | let postgresRepo: jest.Mocked<CartRepository>; |
19 | 19 |
|
@@ -47,14 +47,14 @@ describe('RedisCartRepository', () => { |
47 | 47 |
|
48 | 48 | const module: TestingModule = await Test.createTestingModule({ |
49 | 49 | providers: [ |
50 | | - RedisCartRepository, |
| 50 | + CachedCartRepository, |
51 | 51 | { provide: CacheService, useValue: mockCacheService }, |
52 | 52 | { provide: CartRepository, useValue: mockPostgresRepo }, |
53 | 53 | { provide: Logger, useValue: mockLogger }, |
54 | 54 | ], |
55 | 55 | }).compile(); |
56 | 56 |
|
57 | | - repository = module.get<RedisCartRepository>(RedisCartRepository); |
| 57 | + repository = module.get<CachedCartRepository>(CachedCartRepository); |
58 | 58 | cacheService = module.get(CacheService); |
59 | 59 | postgresRepo = module.get(CartRepository); |
60 | 60 | }); |
|
0 commit comments