Skip to content

java style getters still broken #85

@jendap

Description

@jendap

We've had an issue #73 before. It did not solve all the problems. It's still a regression compared to 2.2.x.

Try following:

  it should "serialize java getters" in {
    class Foo(string: String, boolean: Boolean) {
      def getString = string
      def isBoolean = boolean
    }
    val foo = new Foo("str", false)
    serialize(foo) should equal ("""{"string":"str","boolean":false}""")
  }

  it should "serialize java getters returning java collections" in {
    class Foo(strings: java.util.List[String]) {
      def getStrings: java.util.List[String] = strings
    }
    val foo = new Foo(java.util.Arrays.asList("foo", "bar"))
    serialize(foo) should equal ("""{"strings":["foo","bar"]}""")
  }

BTW: Where to put those tests for a pull request ;-) CaseClassSerializerTest.scala?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions