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

JCR Mocks should declare exceptions identically to JCR interfaces

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Neutral
    • None
    • None
    • core
    • None

    Description

      When testing exception handling you need to throw an exception at a certain method call.

      The simplest way to do this with MockNode would be:

              MockNode currentContentNode = new MockNode() {
                  @Override
                  public String getIdentifier() {
                      throw new RepositoryException("");
                  }
              };
      

      But that doesn't work because MockNode.getIdentifier() doesn't declare any exceptions. This should be fixed for all methods defined in the JCR API and for all mock classes.

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              tmattsson Tobias Mattsson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Bug DoR
                  Task DoD