OrientPyPiUploadHandler extends UploadHandlerSupport { @Override public UploadDefinition getDefinition() { if (definition == null) { definition = getDefinition(PyPiFormat.NAME, false); } return definition; } @Inject  OrientPyPiUploadHandler(
      final ContentPermissionChecker contentPermissionChecker,
      @Named("simple") final VariableResolverAdapter variableResolverAdapter,
      final Set<UploadDefinitionExtension> uploadDefinitionExtensions); @Override Content handle(
      final Repository repository, final File content, final String path); @Override UploadResponse handle(final Repository repository, final ComponentUpload upload); @Override UploadDefinition getDefinition(); @Override VariableResolverAdapter getVariableResolverAdapter(); @Override ContentPermissionChecker contentPermissionChecker(); @Override boolean supportsExportImport();  }
@Test public void testGetDefinition() { UploadDefinition def = underTest.getDefinition(); assertThat(def.getFormat(), is(PyPiFormat.NAME)); assertThat(def.isMultipleUpload(), is(false)); assertThat(def.getComponentFields(), empty()); assertThat(def.getAssetFields(), empty()); }
@Test public void testGetDefinitionWithExtensionContributions() { underTest = new OrientPyPiUploadHandler(contentPermissionChecker, new SimpleVariableResolverAdapter(), getDefinitionExtensions()); UploadDefinition def = underTest.getDefinition(); assertThat(def.getComponentFields(), contains(new UploadFieldDefinition("foo", "Foo", null, true, STRING, "bar"))); assertThat(def.getAssetFields(), empty()); }