Skip to content

Commit

Permalink
test(*): fix regressions
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Casey <[email protected]>
  • Loading branch information
jonathan-casey committed Nov 3, 2023
1 parent 1a55b9d commit 0746a66
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
8 changes: 8 additions & 0 deletions test/codegen/__snapshots__/codegen.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,8 @@ import concerto.Asset;
import concerto.Transaction;
import concerto.Participant;
import concerto.Event;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.*;

@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "$class")
Expand Down Expand Up @@ -1253,6 +1255,8 @@ import concerto.Asset;
import concerto.Transaction;
import concerto.Participant;
import concerto.Event;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.*;

@JsonIgnoreProperties({"id"})
Expand Down Expand Up @@ -6613,6 +6617,8 @@ import concerto.Asset;
import concerto.Transaction;
import concerto.Participant;
import concerto.Event;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.*;

@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "$class")
Expand Down Expand Up @@ -6801,6 +6807,8 @@ import concerto.Asset;
import concerto.Transaction;
import concerto.Participant;
import concerto.Event;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.*;

@JsonIgnoreProperties({"id"})
Expand Down
14 changes: 13 additions & 1 deletion test/codegen/fromcto/java/javamissingplugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ const sinon = require('sinon');

const JavaVisitor = require('../../../../lib/codegen/fromcto/java/javavisitor.js');
const AbstractPlugin = require('../../../../lib/codegen/abstractplugin.js');
const ModelUtil = require('@accordproject/concerto-core').ModelUtil;

const ClassDeclaration = require('@accordproject/concerto-core').ClassDeclaration;
const EnumDeclaration = require('@accordproject/concerto-core').EnumDeclaration;
const FileWriter = require('@accordproject/concerto-util').FileWriter;

let sandbox = sinon.createSandbox();

describe('JavaMissingPlugin', function () {
let javaVisit;
let mockFileWriter;
Expand Down Expand Up @@ -115,6 +118,15 @@ describe('JavaMissingPlugin', function () {

sinon.stub(javaVisit, 'startClassFile');
sinon.stub(javaVisit, 'endClassFile');

sandbox.stub(ModelUtil, 'isMap').callsFake(() => {
return true;
});
});

afterEach(() => {
sandbox.restore();

});

it('should fail to write a class declaration and call accept on each property', () => {
Expand All @@ -126,4 +138,4 @@ describe('JavaMissingPlugin', function () {
});
});

});
});
7 changes: 7 additions & 0 deletions test/codegen/fromcto/java/javavisitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ describe('JavaVisitor', function () {
beforeEach(() => {
javaVisit = new JavaVisitor();
mockFileWriter = sinon.createStubInstance(FileWriter);
sandbox.stub(ModelUtil, 'isMap').callsFake(() => {
return false;
});
});

afterEach(() => {
sandbox.restore();
});

describe('visit', () => {
Expand Down

0 comments on commit 0746a66

Please sign in to comment.