Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-6827

Getting a non-existent parameter from a MockWebContext should not cause a NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Neutral Neutral
    • None
    • 5.4.8
    • testing
    • None

      Currently this test fails:

      @Test
      public void gettingNonExistentParamaterShouldNotCauseNullPointerException() {
          assertThat(new MockWebContext().getParameter("doesNotExist")).isNull();
      }
      

      The cause seems to be that MockWebContext.java:94 calls getParameters(), which is null until explicitly set. The result of getParameters() should be checked for null before calling a method on it (or be guaranteed to not be null).

        Acceptance criteria

              Unassigned Unassigned
              breun Nils Breunese
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:

                  Bug DoR
                  Task DoD