code: public void registerMockResource(String location, String contents) {
          try {
              mockResources.put(location, new GrailsByteArrayResource(contents.getBytes("UTF-8"), location));
          }
          catch (UnsupportedEncodingException e) {
              throw new RuntimeException(e);
          }
      }
docs: Registers a mock resource with the first argument as the location and the second as the contents
  of the resource.
  
  @param location The location
  @param contents The contents of the resource