From d4b5d3f456568edff43503927b438f5027d0c5ba Mon Sep 17 00:00:00 2001 From: Tom Daffurn Date: Thu, 12 Sep 2024 15:41:15 +1000 Subject: [PATCH] Fix map value types --- .../src/main/java/xyz/block/ftl/deployment/ModuleBuilder.java | 2 +- jvm-runtime/jvm_integration_test.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/jvm-runtime/ftl-runtime/common/deployment/src/main/java/xyz/block/ftl/deployment/ModuleBuilder.java b/jvm-runtime/ftl-runtime/common/deployment/src/main/java/xyz/block/ftl/deployment/ModuleBuilder.java index dba6f6acd4..7a078a04db 100644 --- a/jvm-runtime/ftl-runtime/common/deployment/src/main/java/xyz/block/ftl/deployment/ModuleBuilder.java +++ b/jvm-runtime/ftl-runtime/common/deployment/src/main/java/xyz/block/ftl/deployment/ModuleBuilder.java @@ -363,7 +363,7 @@ public Type buildType(org.jboss.jandex.Type type, boolean export) { } else if (paramType.name().equals(DotName.createSimple(Map.class))) { return Type.newBuilder().setMap(xyz.block.ftl.v1.schema.Map.newBuilder() .setKey(buildType(paramType.arguments().get(0), export)) - .setValue(buildType(paramType.arguments().get(0), export))) + .setValue(buildType(paramType.arguments().get(1), export))) .build(); } else if (paramType.name().equals(DotNames.OPTIONAL)) { //TODO: optional kinda sucks diff --git a/jvm-runtime/jvm_integration_test.go b/jvm-runtime/jvm_integration_test.go index b9d3fac1c9..f378d3178e 100644 --- a/jvm-runtime/jvm_integration_test.go +++ b/jvm-runtime/jvm_integration_test.go @@ -111,8 +111,7 @@ func TestJVMToGoCall(t *testing.T) { })...) tests = append(tests, PairedVerbTest("testObjectVerb", exampleObject)...) tests = append(tests, PairedVerbTest("testObjectOptionalFieldsVerb", exampleOptionalFieldsObject)...) - // TODO turn on when https://github.com/TBD54566975/ftl/issues/2651 is fixed - //tests = append(tests, PairedVerbTest("objectMapVerb", map[string]TestObject{"hello": exampleObject})...) + tests = append(tests, PairedVerbTest("objectMapVerb", map[string]TestObject{"hello": exampleObject})...) tests = append(tests, PairedVerbTest("objectArrayVerb", []TestObject{exampleObject})...) tests = append(tests, PairedVerbTest("parameterizedObjectVerb", parameterizedObject)...) tests = append(tests, PairedVerbTest("optionalIntVerb", -3)...)