From e498c2e755e23af3937cf745ef1688442addea51 Mon Sep 17 00:00:00 2001 From: Tom Daffurn Date: Thu, 12 Sep 2024 12:15:41 +1000 Subject: [PATCH] the actual tests --- jvm-runtime/jvm_integration_test.go | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/jvm-runtime/jvm_integration_test.go b/jvm-runtime/jvm_integration_test.go index d3e3b048a2..57ebaa4b6b 100644 --- a/jvm-runtime/jvm_integration_test.go +++ b/jvm-runtime/jvm_integration_test.go @@ -65,6 +65,12 @@ func TestJVMToGoCall(t *testing.T) { ArrayField: ftl.Some[[]string]([]string{"foo", "bar"}), MapField: ftl.Some[map[string]string](map[string]string{"gar": "har"}), } + parameterizedObject := ParameterizedType[string]{ + Value: "foo", + Array: []string{"foo"}, + Option: ftl.Some[string]("foo"), + Map: map[string]string{"foo": "bar"}, + } tests := []in.SubTest{} tests = append(tests, PairedTest("emptyVerb", func(module string) in.Action { @@ -139,11 +145,12 @@ func TestJVMToGoCall(t *testing.T) { // tests = append(tests, PairedPrefixVerbTest("nilvalue", "optionalTestObjectOptionalFieldsVerb", ftl.None[any]())...) in.Run(t, - in.WithLanguages("kotlin", "java"), in.CopyModuleWithLanguage("gomodule", "go"), - in.CopyModule("passthrough"), + in.CopyModuleWithLanguage("javamodule", "java"), + in.CopyModuleWithLanguage("kotlinmodule", "kotlin"), in.Deploy("gomodule"), - in.Deploy("passthrough"), + in.Deploy("javamodule"), + in.Deploy("kotlinmodule"), in.SubTests(tests...), ) } @@ -166,8 +173,12 @@ func PairedTest(name string, testFunc func(module string) in.Action) []in.SubTes Action: testFunc("gomodule"), }, { - Name: name + "-jvm", - Action: testFunc("passthrough"), + Name: name + "-java", + Action: testFunc("javamodule"), + }, + { + Name: name + "-kotlin", + Action: testFunc("kotlinmodule"), }, } } @@ -209,3 +220,10 @@ type TestObjectOptionalFields struct { ArrayField ftl.Option[[]string] `json:"arrayField"` MapField ftl.Option[map[string]string] `json:"mapField"` } + +type ParameterizedType[T any] struct { + Value T `json:"value"` + Array []T `json:"array"` + Option ftl.Option[T] `json:"option"` + Map map[string]T `json:"map"` +}