Uploaded image for project: 'mod-circulation'
  1. mod-circulation
  2. CIRC-595

Item in transit report tests have implicit type conversation for tags

    XMLWordPrintable

Details

    Description

      I use Java 13 locally on my development machine. During local development, I encountered issues with the ItemsInTransitReportTests.

      I think it is to do with this section of code.

      quote
      Map<String, String> actualRequest = (Map<String, String>) itemJson.getMap().get(REQUEST);

      assertThat(actualRequest.get(TAGS), is(Arrays.asList("tag1", "tag2")));
      quote

      Somehow, despite actualRequest being a map of String values, actualRequest.get(TAGS) return a ArrayList, which is bizarre to me.

      I don't understand enough about this Java generics to understand why this happens, I imagine it has something to do with type erasure, that Java 9-13 makes stricter.

      I think it would be good to get this fixed, as I think it is a bug or instability waiting to happen.

      I don't understand why the tests aren't using JSONObject instead of a Map.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                marcjohnson Marc Johnson
                marcjohnson Marc Johnson
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases