Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update sequence with master data #77

Merged
merged 3 commits into from
Nov 27, 2024

Merge pull request #76 from mbc-net/feat/sequence-update

0831f5f
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

update sequence with master data #77

Merge pull request #76 from mbc-net/feat/sequence-update
0831f5f
Select commit
Loading
Failed to load commit list.
GitHub Actions / Unit Tests Reporter succeeded Nov 27, 2024 in 1s

129 passed, 0 failed and 0 skipped

Tests passed successfully

✅ report/unit.xml

129 tests were completed in 16s with 129 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
CommandService 13✅ 2s
DataSyncCommandSfnEventHandler 13✅ 11s
DataSyncCommandSfnEventHandler 2✅ 2s
DataSyncNewCommandEventHandler 1✅ 1s
DynamoDbService 12✅ 10s
DynamoDbService 3✅ 2s
EventBus 2✅ 959ms
ExplorerService 5✅ 730ms
getPackageVersion 2✅ 478ms
isLatestCli 2✅ 416ms
mergeDeep 13✅ 551ms
newAction 3✅ 720ms
RequestLogger.getLogLevels 6✅ 418ms
RolesGuard 4✅ 817ms
SequencesService 44✅ 10s
usePackageVersion 4✅ 3s

✅ CommandService

CommandService getLatestItem should return latest item
  ✅ CommandService getLatestItem should return latest item
CommandService getLatestItem should return null when data not have key
  ✅ CommandService getLatestItem should return null when data not have key
CommandService publishPartialUpdateAsync should update with the latest item
  ✅ CommandService publishPartialUpdateAsync should update with the latest item
CommandService publishPartialUpdateAsync should raise error with the non-existent item
  ✅ CommandService publishPartialUpdateAsync should raise error with the non-existent item
CommandService isNotCommandDirty should return true if command is not dirty
  ✅ CommandService isNotCommandDirty should return true if command is not dirty
CommandService isNotCommandDirty should return false if command is dirty
  ✅ CommandService isNotCommandDirty should return false if command is dirty
CommandService isNotCommandDirty should return true if input attributes is class instance
  ✅ CommandService isNotCommandDirty should return true if input attributes is class instance
CommandService isNotCommandDirty should return false if input attributes is class instance and not dirty
  ✅ CommandService isNotCommandDirty should return false if input attributes is class instance and not dirty
CommandService publishPartialUpdateSync should update with the latest version item
  ✅ CommandService publishPartialUpdateSync should update with the latest version item
CommandService publishPartialUpdateSync should raise error with invalid version
  ✅ CommandService publishPartialUpdateSync should raise error with invalid version
CommandService publishPartialUpdateSync should raise error with item not found
  ✅ CommandService publishPartialUpdateSync should raise error with item not found
CommandService publishSync should update with the latest version item
  ✅ CommandService publishSync should update with the latest version item
CommandService publishSync should raise error with invalid input version
  ✅ CommandService publishSync should raise error with invalid input version

✅ DataSyncCommandSfnEventHandler

DataSyncCommandSfnEventHandler execute should return result = 0 when executing the correct check version event
  ✅ DataSyncCommandSfnEventHandler execute should return result = 0 when executing the correct check version event
DataSyncCommandSfnEventHandler execute should return result = 1 when executing the correct check version event and the data is not stable
  ✅ DataSyncCommandSfnEventHandler execute should return result = 1 when executing the correct check version event and the data is not stable
DataSyncCommandSfnEventHandler execute should return result = -1 when executing the stale check version event 
  ✅ DataSyncCommandSfnEventHandler execute should return result = -1 when executing the stale check version event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct check version event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct check version event
DataSyncCommandSfnEventHandler execute should return result = ok when executing the correct history copy event
  ✅ DataSyncCommandSfnEventHandler execute should return result = ok when executing the correct history copy event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct history copy event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct history copy event
DataSyncCommandSfnEventHandler execute should return the array of handlers when executing the correct transform data event
  ✅ DataSyncCommandSfnEventHandler execute should return the array of handlers when executing the correct transform data event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct transform data event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct transform data event
DataSyncCommandSfnEventHandler execute should throw not found handler error when executing the sync data event
  ✅ DataSyncCommandSfnEventHandler execute should throw not found handler error when executing the sync data event
DataSyncCommandSfnEventHandler execute should throw empty handler error when executing the sync data event
  ✅ DataSyncCommandSfnEventHandler execute should throw empty handler error when executing the sync data event
DataSyncCommandSfnEventHandler execute should call handler up when executing the correct sync data event
  ✅ DataSyncCommandSfnEventHandler execute should call handler up when executing the correct sync data event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct sync data event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the correct sync data event
DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the finish data event
  ✅ DataSyncCommandSfnEventHandler execute should call the AWS service with the correct parameters when executing the finish data event

✅ DataSyncCommandSfnEventHandler

DataSyncCommandSfnEventHandler execute should be call event with the correct event and handler
  ✅ DataSyncCommandSfnEventHandler execute should be call event with the correct event and handler
DataSyncCommandSfnEventHandler execute should not be call event with the wrong handler
  ✅ DataSyncCommandSfnEventHandler execute should not be call event with the wrong handler

✅ DataSyncNewCommandEventHandler

DataSyncNewCommandEventHandler should trigger step function with the correct start command
  ✅ DataSyncNewCommandEventHandler should trigger step function with the correct start command

✅ DynamoDbService

DynamoDbService get should return the dynamodb client
  ✅ DynamoDbService get should return the dynamodb client
DynamoDbService putItem should send PutItemCommand with the origin data
  ✅ DynamoDbService putItem should send PutItemCommand with the origin data
DynamoDbService putItem should send a PutItemCommand with the data and store the attribute in S3
  ✅ DynamoDbService putItem should send a PutItemCommand with the data and store the attribute in S3
DynamoDbService getItem should send GetItemCommand
  ✅ DynamoDbService getItem should send GetItemCommand
DynamoDbService getItem should return the data
  ✅ DynamoDbService getItem should return the data
DynamoDbService getItem should get the attribute data from s3 and return the data
  ✅ DynamoDbService getItem should get the attribute data from s3 and return the data
DynamoDbService updateItem should return updated attributes
  ✅ DynamoDbService updateItem should return updated attributes
DynamoDbService updateItem should send UpdateItemCommand
  ✅ DynamoDbService updateItem should send UpdateItemCommand
DynamoDbService listItemsByPk should return data
  ✅ DynamoDbService listItemsByPk should return data
DynamoDbService listItemsByPk should send QueryCommand
  ✅ DynamoDbService listItemsByPk should send QueryCommand
DynamoDbService listAllItems should return data
  ✅ DynamoDbService listAllItems should return data
DynamoDbService listAllItems should send ScanCommand
  ✅ DynamoDbService listAllItems should send ScanCommand

✅ DynamoDbService

DynamoDbService get should return the dynamodb client
  ✅ DynamoDbService get should return the dynamodb client
DynamoDbService getItem should retrieve data from s3 and return it
  ✅ DynamoDbService getItem should retrieve data from s3 and return it
DynamoDbService putItem should upload data to s3
  ✅ DynamoDbService putItem should upload data to s3

✅ EventBus

EventBus should execute event correctly
  ✅ EventBus should execute event correctly
EventBus should throw not found error
  ✅ EventBus should throw not found error

✅ ExplorerService

ExplorerService explore should discover event handler correctly
  ✅ ExplorerService explore should discover event handler correctly
ExplorerService explore should be defined
  ✅ ExplorerService explore should be defined
ExplorerService explore should discover event factory correctly
  ✅ ExplorerService explore should discover event factory correctly
ExplorerService exploreDataSyncHandlers should discover data sync handler correctly
  ✅ ExplorerService exploreDataSyncHandlers should discover data sync handler correctly
ExplorerService exploreDataSyncHandlers should return no data sync handler
  ✅ ExplorerService exploreDataSyncHandlers should return no data sync handler

✅ getPackageVersion

getPackageVersion should return the latest version when isLatest is true
  ✅ getPackageVersion should return the latest version when isLatest is true
getPackageVersion should return all versions when isLatest is false
  ✅ getPackageVersion should return all versions when isLatest is false

✅ isLatestCli

isLatestCli should return true if the current version matches the latest version
  ✅ isLatestCli should return true if the current version matches the latest version
isLatestCli should return false if the current version does not match the latest version
  ✅ isLatestCli should return false if the current version does not match the latest version

✅ mergeDeep

mergeDeep should merge two objects
  ✅ mergeDeep should merge two objects
mergeDeep should merge deeply nested objects
  ✅ mergeDeep should merge deeply nested objects
mergeDeep should merge 3 nested objects
  ✅ mergeDeep should merge 3 nested objects
mergeDeep should return the target object when no sources are provided
  ✅ mergeDeep should return the target object when no sources are provided
mergeDeep should deep merge two objects
  ✅ mergeDeep should deep merge two objects
mergeDeep should deep merge multiple objects
  ✅ mergeDeep should deep merge multiple objects
mergeDeep should handle primitive values
  ✅ mergeDeep should handle primitive values
objectBytes should calculate the object bytes
  ✅ objectBytes should calculate the object bytes
objectBytes should return the correct byte length for an empty object
  ✅ objectBytes should return the correct byte length for an empty object
objectBytes should return the correct byte length for an object with properties
  ✅ objectBytes should return the correct byte length for an object with properties
objectBytes should return the correct byte length for an object with nested objects
  ✅ objectBytes should return the correct byte length for an object with nested objects
isObject should check if an object is an object
  ✅ isObject should check if an object is an object
isObject should check if an object is not an object
  ✅ isObject should check if an object is not an object

✅ newAction

newAction should generate a project with the latest version when version is not specified
  ✅ newAction should generate a project with the latest version when version is not specified
newAction should use a specific version if specified
  ✅ newAction should use a specific version if specified
newAction should throw an error for an invalid version
  ✅ newAction should throw an error for an invalid version

✅ RequestLogger.getLogLevels

RequestLogger.getLogLevels should return all log levels
  ✅ RequestLogger.getLogLevels should return all log levels
RequestLogger.getLogLevels should return log levels from debug
  ✅ RequestLogger.getLogLevels should return log levels from debug
RequestLogger.getLogLevels should return log levels from info
  ✅ RequestLogger.getLogLevels should return log levels from info
RequestLogger.getLogLevels should return log levels from warn
  ✅ RequestLogger.getLogLevels should return log levels from warn
RequestLogger.getLogLevels should return log levels from error
  ✅ RequestLogger.getLogLevels should return log levels from error
RequestLogger.getLogLevels should return log levels from fatal
  ✅ RequestLogger.getLogLevels should return log levels from fatal

✅ RolesGuard

RolesGuard should return false if tenant code does not exist
  ✅ RolesGuard should return false if tenant code does not exist
RolesGuard should return true if the user has the system admin role
  ✅ RolesGuard should return true if the user has the system admin role
RolesGuard should return true if the user has the user role
  ✅ RolesGuard should return true if the user has the user role
RolesGuard should return false if the user has only the user role
  ✅ RolesGuard should return false if the user has only the user role

✅ SequencesService

SequencesService should be defined
  ✅ SequencesService should be defined
SequencesService should get table name on initialization
  ✅ SequencesService should get table name on initialization
SequencesService getCurrentSequence should call getItem with correct parameters and return the result
  ✅ SequencesService getCurrentSequence should call getItem with correct parameters and return the result
SequencesService getFiscalYear should calculate the fiscal year using default start month (April) and reference year 1953
  ✅ SequencesService getFiscalYear should calculate the fiscal year using default start month (April) and reference year 1953
SequencesService getFiscalYear should calculate the fiscal year using a custom start month (July)
  ✅ SequencesService getFiscalYear should calculate the fiscal year using a custom start month (July)
SequencesService getFiscalYear should calculate the fiscal year using a custom register time (2020)
  ✅ SequencesService getFiscalYear should calculate the fiscal year using a custom register time (2020)
SequencesService getFiscalYear should calculate the fiscal year using a custom register time and start month (July)
  ✅ SequencesService getFiscalYear should calculate the fiscal year using a custom register time and start month (July)
SequencesService getFiscalYear should handle the case where now is exactly the start of the fiscal year
  ✅ SequencesService getFiscalYear should handle the case where now is exactly the start of the fiscal year
SequencesService getFiscalYear should handle the case where now is just before the fiscal year starts
  ✅ SequencesService getFiscalYear should handle the case where now is just before the fiscal year starts
SequencesService getFiscalYear should calculate the fiscal year when now is after the fiscal year start, but before the start month
  ✅ SequencesService getFiscalYear should calculate the fiscal year when now is after the fiscal year start, but before the start month
SequencesService getFiscalYear should return a negative fiscal year when registerTime is in the future
  ✅ SequencesService getFiscalYear should return a negative fiscal year when registerTime is in the future
SequencesService getFiscalYear should return fiscal year 1 when now and registerTime fall within the same fiscal year
  ✅ SequencesService getFiscalYear should return fiscal year 1 when now and registerTime fall within the same fiscal year
SequencesService getFiscalYear should return the fiscal year using defaults (starting from 1953)
  ✅ SequencesService getFiscalYear should return the fiscal year using defaults (starting from 1953)
SequencesService getFiscalYear should return a high fiscal year number when registerTime is very early (e.g., 1900)
  ✅ SequencesService getFiscalYear should return a high fiscal year number when registerTime is very early (e.g., 1900)
SequencesService getRotateBy should return fiscal year when rotateBy is FISCAL_YEARLY
  ✅ SequencesService getRotateBy should return fiscal year when rotateBy is FISCAL_YEARLY
SequencesService getRotateBy should return year when rotateBy is YEARLY
  ✅ SequencesService getRotateBy should return year when rotateBy is YEARLY
SequencesService getRotateBy should return year and month when rotateBy is MONTHLY
  ✅ SequencesService getRotateBy should return year and month when rotateBy is MONTHLY
SequencesService getRotateBy should return year, month, and day when rotateBy is DAILY
  ✅ SequencesService getRotateBy should return year, month, and day when rotateBy is DAILY
SequencesService getRotateBy should return RotateByEnum.NONE for undefined or unhandled rotateBy
  ✅ SequencesService getRotateBy should return RotateByEnum.NONE for undefined or unhandled rotateBy
SequencesService getRotateBy should return true if rotateBy is not provided
  ✅ SequencesService getRotateBy should return true if rotateBy is not provided
SequencesService getRotateBy should return true if rotateBy is FISCAL_YEARLY and fiscal year matches
  ✅ SequencesService getRotateBy should return true if rotateBy is FISCAL_YEARLY and fiscal year matches
SequencesService getRotateBy should return false if rotateBy is FISCAL_YEARLY and fiscal year does not match
  ✅ SequencesService getRotateBy should return false if rotateBy is FISCAL_YEARLY and fiscal year does not match
SequencesService getRotateBy should return false if rotateBy is MONTHLY and issued year does not match current year
  ✅ SequencesService getRotateBy should return false if rotateBy is MONTHLY and issued year does not match current year
SequencesService getRotateBy should return false if rotateBy is MONTHLY and issued month does not match current month but matches year
  ✅ SequencesService getRotateBy should return false if rotateBy is MONTHLY and issued month does not match current month but matches year
SequencesService getRotateBy should return false if rotateBy is YEARLY and issued year does not match current year
  ✅ SequencesService getRotateBy should return false if rotateBy is YEARLY and issued year does not match current year
SequencesService getRotateBy should return true if rotateBy is MONTHLY and issued month matches current month and year
  ✅ SequencesService getRotateBy should return true if rotateBy is MONTHLY and issued month matches current month and year
SequencesService generateSequenceItem should call generateSequenceItem with none rotation
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation
SequencesService generateSequenceItem should call generateSequenceItem with none rotation at second time
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation at second time
SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation
SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation, argument is a fiscal year that is the same as the previous fiscal year
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation, argument is a fiscal year that is the same as the previous fiscal year
SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation, argument is a fiscal year other than the previous fiscal year
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with fiscal yearly rotation, argument is a fiscal year other than the previous fiscal year
SequencesService generateSequenceItem should call generateSequenceItem with yearly rotation
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with yearly rotation
SequencesService generateSequenceItem should call generateSequenceItem with  yearly rotation, argument is a  year that is the same as the previous year
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with  yearly rotation, argument is a  year that is the same as the previous year
SequencesService generateSequenceItem should call generateSequenceItem with  yearly rotation, argument is a  year other than the previous  year
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with  yearly rotation, argument is a  year other than the previous  year
SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation
SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation, argument is a month other than the previous month
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation, argument is a month other than the previous month
SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation, argument is a month that is the same as the previous month
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with monthly rotation, argument is a month that is the same as the previous month
SequencesService generateSequenceItem should call generateSequenceItem with daily rotation 
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with daily rotation
SequencesService generateSequenceItem should call generateSequenceItem with daily rotation, argument is a day other than the previous day
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with daily rotation, argument is a day other than the previous day
SequencesService generateSequenceItem should call generateSequenceItem with daily rotation, the argument is a day that is the same as the previous day
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with daily rotation, the argument is a day that is the same as the previous day
SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  the arguments have code 1, code 2, code 3, code4, code5 
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  the arguments have code 1, code 2, code 3, code4, code5
SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%fiscal_year%%-%%no%%
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%fiscal_year%%-%%no%%
SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%month%%-%%no%%
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%month%%-%%no%%
SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%day%%-%%no%%
  ✅ SequencesService generateSequenceItem should call generateSequenceItem with none rotation,  format is %%code1%%-%%day%%-%%no%%

✅ usePackageVersion

usePackageVersion it should update deps
  ✅ usePackageVersion it should update deps
usePackageVersion it should not update name
  ✅ usePackageVersion it should not update name
usePackageVersion it should not update name with empty name
  ✅ usePackageVersion it should not update name with empty name
usePackageVersion it should update name
  ✅ usePackageVersion it should update name