Skip to content

Commit

Permalink
fix(enum): rename MEBX_PASSWORD to PASSWORD
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-primrose committed Oct 18, 2022
1 parent 1b1cec6 commit 6c61486
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/WSMan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export enum WSManErrors {
IS_ROOT = 'missing isRoot',
TLS_CREDENTIAL_CONTEXT = 'missing tlsCredentialContext',
GENERAL_SETTINGS = 'missing generalSettings',
MEBX_PASSWORD = 'missing password'
PASSWORD = 'missing password'
}

export class WSManMessageCreator {
Expand Down
2 changes: 1 addition & 1 deletion src/amt/messages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ describe('AMT Tests', () => {
expect(response).toEqual(correctResponse)
})
it('should throw an error if password is null for SET_MEBX_PASSWORD', () => {
expect(() => { amtClass.SetupAndConfigurationService(Methods.SET_MEBX_PASSWORD, null) }).toThrow(WSManErrors.MEBX_PASSWORD)
expect(() => { amtClass.SetupAndConfigurationService(Methods.SET_MEBX_PASSWORD, null) }).toThrow(WSManErrors.PASSWORD)
})
it('should return a valid amt_SetupAndConfigurationService Unprovision wsman message', () => {
const correctResponse = `${xmlHeader}${envelope}http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService/Unprovision</a:Action><a:To>/wsman</a:To><w:ResourceURI>http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService</w:ResourceURI><a:MessageID>${(messageId++).toString()}</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>${operationTimeout}</w:OperationTimeout></Header><Body><r:Unprovision_INPUT xmlns:r="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SetupAndConfigurationService"><r:ProvisioningMode>1</r:ProvisioningMode></r:Unprovision_INPUT></Body></Envelope>`
Expand Down
2 changes: 1 addition & 1 deletion src/amt/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class Messages {
body = `<Body><r:Unprovision_INPUT xmlns:r="${this.resourceUriBase}${Classes.AMT_SETUP_AND_CONFIGURATION_SERVICE}"><r:ProvisioningMode>${provisioningMode}</r:ProvisioningMode></r:Unprovision_INPUT></Body>`
return this.wsmanMessageCreator.createXml(header, body)
case Methods.SET_MEBX_PASSWORD:
if (password == null) throw new Error(WSManErrors.MEBX_PASSWORD)
if (password == null) throw new Error(WSManErrors.PASSWORD)
header = this.wsmanMessageCreator.createHeader(Actions.SET_MEBX_PASSWORD, `${this.resourceUriBase}${Classes.AMT_SETUP_AND_CONFIGURATION_SERVICE}`)
body = `<Body><r:SetMEBxPassword_INPUT xmlns:r="${this.resourceUriBase}${Classes.AMT_SETUP_AND_CONFIGURATION_SERVICE}"><r:Password>${password}</r:Password></r:SetMEBxPassword_INPUT></Body>`
return this.wsmanMessageCreator.createXml(header, body)
Expand Down

0 comments on commit 6c61486

Please sign in to comment.