Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
feat: simplified test and moved comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Jul 20, 2023
1 parent 76e5f6f commit 7a5a76e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions force-app/main/default/classes/HelloWorldTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ public with sharing class HelloWorldTest {
public static void helloWorldStaticInvocation() {
DataWeave.Script script = new DataWeaveScriptResource.helloWorld();
DataWeave.Result result = script.execute(new Map<String, Object>());
Assert.areEqual('"Hello World"', result.getValueAsString(), 'Log output becomes the value when there are no other results');

Assert.areEqual('"Hello World"', result.getValueAsString(), 'getValueAsString should be idempotent');

// DW log output becomes the value when there are no other results
Assert.areEqual('"Hello World"', result.getValueAsString());
}

// Uses the /dw/helloWorld.dwl script to log a message
@IsTest
public static void helloWorldDynamicInvocation() {
DataWeave.Script script = DataWeave.Script.createScript('helloWorld');
DataWeave.Result result = script.execute(new Map<String, Object>());
Assert.areEqual('"Hello World"', result.getValueAsString(), 'Log output becomes the value when there are no other results');

Assert.areEqual('"Hello World"', result.getValueAsString(), 'getValueAsString should be idempotent');

// DW log output becomes the value when there are no other results
Assert.areEqual('"Hello World"', result.getValueAsString());
}
}

0 comments on commit 7a5a76e

Please sign in to comment.