Skip to content

Commit

Permalink
api/certificates/software test
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRufino committed Nov 7, 2023
1 parent 25c40e9 commit 9a41e7d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/test-cases/orders.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const getCertificateParams = (certificateFormat, user) => {

function mountOrderRequest(
hasPresetUser = false,
certificateFormat = CertificateFormats.PKI_BRAZIL
certificateFormat = CertificateFormats.PKI_BRAZIL,
caId = null
) {

const user = hasPresetUser
Expand All @@ -64,7 +65,7 @@ function mountOrderRequest(

// Create an order request.
const request = new CreateOrderRequest({
caId: Config.AMPLIA_CA_ID,
caId: caId != null ? caId : Config.AMPLIA_CA_ID ,
validityEnd: generators.generateDateTwoYearsFromNow(),
kind: CertificateKinds.PUBLIC_KEY,
parameters: getCertificateParams(certificateFormat, user),
Expand Down Expand Up @@ -256,3 +257,15 @@ describe.each(certificateFormats)('Test Cases for Amplia Node Client', ({certifi
);
// end Test Case #3 for Amplia Node Client
});
describe("Software Certificate Case", function(){

Check failure on line 260 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (12.x)

Strings must use singlequote

Check failure on line 260 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Strings must use singlequote

Check failure on line 260 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (16.x)

Strings must use singlequote

test("Issue", async function(){

Check failure on line 262 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (12.x)

Strings must use singlequote

Check failure on line 262 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Strings must use singlequote

Check failure on line 262 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (16.x)

Strings must use singlequote
// This test require api/certificates/software endpoint to work properly

var request = mountOrderRequest(true,CertificateFormats.PKI_BRAZIL);
const order = await ampliaClient.createOrder(request);
var result = await ampliaClient.issueSoftwareCertificate(order.id,"1234", 2048);

Check failure on line 267 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (12.x)

Strings must use singlequote

Check failure on line 267 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Strings must use singlequote

Check failure on line 267 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (16.x)

Strings must use singlequote
expect(result).not.toBeNull();
})

Check failure on line 269 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (12.x)

Missing semicolon

Check failure on line 269 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Missing semicolon

Check failure on line 269 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (16.x)

Missing semicolon

})

Check failure on line 271 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (12.x)

Missing semicolon

Check failure on line 271 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (14.x)

Missing semicolon

Check failure on line 271 in test/test-cases/orders.test.js

View workflow job for this annotation

GitHub Actions / lint (16.x)

Missing semicolon

0 comments on commit 9a41e7d

Please sign in to comment.