d

    ddsoyka

    5 years ago
    is it safe to call
    assertEquals(byteArray, otherByteArray)
    and receive the expected result? Or do I need to call
    Arrays.equals()
    instead?
    ilya.gorbunov

    ilya.gorbunov

    5 years ago
    You can use
    array contentEquals otherArray
    to compare two arrays by content and then assert that the result is true. Or you can wrap these arrays in lists and compare that lists:
    assertEquals(byteArray.asList(), otherByteArray.asList())
    d

    ddsoyka

    5 years ago
    Thank you, that's exactly the solution I was looking for!
    This is much nicer:
    assertTrue(bytes contentEquals image!!.data)
    ilya.gorbunov

    ilya.gorbunov

    5 years ago
    The disadvantage of that is when it fails, you'll get a message, something like "expected true, got false".