RUploadHandler extends UploadHandlerSupport { @Override public UploadDefinition getDefinition() { if (definition == null) { List<UploadFieldDefinition> assetField = Arrays.asList( new UploadFieldDefinition(PATH_ID, PACKAGE_PATH_DISPLAY, null, false, Type.STRING, null)); definition = getDefinition(RFormat.NAME, false, Collections.emptyList(), assetField, null); } return definition; } @Inject  RUploadHandler(@Named("simple") final VariableResolverAdapter variableResolverAdapter,
                        final ContentPermissionChecker contentPermissionChecker,
                        final Set<UploadDefinitionExtension> uploadDefinitionExtensions); @Override UploadResponse handle(final Repository repository, final ComponentUpload upload); @Override UploadDefinition getDefinition(); @Override VariableResolverAdapter getVariableResolverAdapter(); @Override ContentPermissionChecker contentPermissionChecker();  }
@Test public void testGetDefinition() { UploadDefinition def = underTest.getDefinition(); assertThat(def.getFormat(), is(RFormat.NAME)); assertThat(def.isMultipleUpload(), is(false)); assertThat(def.getAssetFields(), contains(field("pathId", "Package Path", null, false, STRING, null))); assertThat(def.getAssetFields().size(), is(1)); assertThat(def.getComponentFields().size(), is(0)); }