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

Commit

Permalink
fix: broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Jun 20, 2023
1 parent 5a6773f commit af1736a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion force-app/main/default/classes/CsvToJsonConversionTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public with sharing class CsvToJsonConversionTest {
System.assertNotEquals(null, c.MailingStreet);

if(c.FirstName=='Donette' && c.LastName=='Foller') {
System.assertEquals('34 Center St\r\n#42', c.MailingStreet);
System.assertEquals('34 Center St\n#42', c.MailingStreet);
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions force-app/main/default/classes/CsvToObjectTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public with sharing class CsvToObjectTest {
Assert.isNotNull(c.Address);

if(c.FirstName=='Donette' && c.LastName=='Foller') {
Assert.areEqual('34 Center St\r\n#42', c.Address);
Assert.areEqual('34 Center St\n#42', c.Address);
}
}
}
Expand Down Expand Up @@ -70,6 +70,4 @@ public with sharing class CsvToObjectTest {

System.debug('Heap: ' + Limits.getHeapSize() + '/' + Limits.getLimitHeapSize());
}


}
8 changes: 4 additions & 4 deletions force-app/main/default/classes/MultipleInputsTest.cls
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ public with sharing class MultipleInputsTest {
public static void multipleInputs() {
Map<String, Object> inputs = new Map<String, Object>();

inputs.put('payload', '[ { "type": "book", "price": 30, "properties": { "title": "Everyday Italian", "author": [ "Giada De Laurentiis" ], "year": 2005 } }, { "type": "book", "price": 29.99, "properties": { "title": "Harry Potter", "author": [ "J K. Rowling" ], "year": 2005 } }, { "type": "book", "price": 41.12, "properties": { "title": "Mule in Action", "author": [ "David Dossot", "John D\'Emic" ], "year": 2009 } }, { "type": "book", "price": 49.99, "properties": { "title": "XQuery Kick Start", "author": [ "James McGovern", "Per Bothner", "Kurt Cagle", "James Linn", "Kurt Cagle", "Vaidyanathan Nagarajan" ], "year": 2003 } }, { "type": "book", "price": 39.95, "properties": { "title": "Learning XML", "author": [ "Erik T. Ray" ], "year": 2003 } }]');
inputs.put('payload', '[ { "type": "book", "price": 30, "properties": { "title": "Everyday Italian", "author": [ "Giada De Laurentiis" ], "year": 2005 } }, { "type": "book", "price": 29.99, "properties": { "title": "Harry Potter", "author": [ "J K. Rowling" ], "year": 2005 } }, { "type": "book", "price": 41.12, "properties": { "title": "Mule in Action", "author": [ "David Dossot", "John D\'Emic" ], "year": 2009 } }, { "type": "book", "price": 49.99, "properties": { "title": "XQuery Kick Start", "author": [ "James McGovern", "Per Bothner", "Kurt Cagle", "James Linn", "Kurt Cagle", "Vaidyanathan Nagarajan" ], "year": 2003 } }, { "type": "book", "price": 39.95, "properties": { "title": "Learning XML", "author": [ "Erik T. Ray" ], "year": 2003 } }]');
inputs.put('attributes', '{"publishedAfter": 2004}');
inputs.put('exchangeRate', '{ "USD": [ {"currency": "EUR", "ratio":0.92}, {"currency": "ARS", "ratio":8.76}, {"currency": "GBP", "ratio":0.66} ]}');
inputs.put('exchangeRate', '{ "USD": [ {"currency": "EUR", "ratio":0.92}, {"currency": "ARS", "ratio":8.76}, {"currency": "GBP", "ratio":0.66} ]}');

DataWeave.Script dwscript = DataWeave.Script.createScript('multipleInputs');
DataWeave.Result result = dwscript.execute(inputs);

Expand All @@ -19,6 +19,6 @@ public with sharing class MultipleInputsTest {
system.debug('xml output'+ output);

System.assert(output.contains('<author>Giada De Laurentiis</author>'), output);
System.assert(output.contains('<price currency="ARS">262.80</price>'), output);
System.assert(output.contains('<price currency="ARS">262.8</price>'), output);
}
}

0 comments on commit af1736a

Please sign in to comment.