title: add Value to my multiPart in Junit (using jersey)
body: <p>Hello i met an issue when testing my jersey web service with junit. I tried to add a value in my param </p>
  
  <pre><code>@POST
  @Consumes(MediaType.MULTIPART_FORM_DATA)
  @Produces(MediaType.APPLICATION_JSON)
  public Response parsingPdfOrange(@FormDataParam("fichier") InputStream uploadedInputStream,
          @FormDataParam("fichier") FormDataContentDisposition fileDetail,
          @FormDataParam("TypeFacture") String typeFile) {
      try {
          // my code //
  
          return Response.status(201).entity(info).build();
  }catch Exception e{
          return Response.status(406).entity("pb").build();
  }
  </code></pre>
  
  <p>but i have no idea to add my typeFile into my entity, i've tried this but the string isn't communicate and return a nullpointerexeption</p>
  
  <pre><code>    @Test
  public void parsePDF_TemplateNotExist() throws Exception {
  
  
  
          FileDataBodyPart filePart = new FileDataBodyPart("fichier", new File(currentpath+FactureValide));
          BodyPart filePart2 = new BodyPart(templateName, MediaType.TEXT_PLAIN_TYPE);
  
          FormDataMultiPart formDataMultipart = new FormDataMultiPart();
          FormDataMultiPart multipart = (FormDataMultiPart) formDataMultipart.bodyPart(filePart).bodyPart(filePart2);
  
          Response response = (target("pdf").request().post(Entity.entity(multipart, MediaType.MULTIPART_FORM_DATA)));
          System.out.println(currentpath);
          response.close();
          formDataMultipart.close();
  }
  </code></pre>
  
  <p>i wish to know how i can resolve my pb and communicate the 2 entities for the test</p>
  
  <p>Edit: this is my jsp
      &lt;%@ page pageEncoding="UTF-8" %>
  </p>
  
  <pre><code>&lt;html&gt;
      &lt;meta content="text/html;charset=utf-8" http-equiv="Content-Type" /&gt;
      &lt;meta content="utf-8" http-equiv="encoding" /&gt;
  
   &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  
  
  
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;Envoi de fichier&lt;/title&gt;
      &lt;link type="text/css" rel="stylesheet"/&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form action="&lt;%= request.getContextPath() %&gt;/rest/pdf" method="POST" enctype="multipart/form-data" id="fileUploadForm"&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;Envoi de fichier&lt;/legend&gt;
              &lt;SELECT name="TypeFacture" id=typefacture&gt;
              &lt;option&gt;Facture Orange&lt;/option&gt;
              &lt;option&gt;Facture EDF&lt;/option&gt;
              &lt;/SELECT&gt;
              &lt;label for="fichier"&gt;Emplacement du fichier &lt;span class="requis"&gt;*&lt;/span&gt;&lt;/label&gt;
              &lt;input type="file" id="fichier" name="fichier" accept=".pdf" /&gt;
              &lt;br /&gt;
  
              &lt;input type="submit" value="Envoyer" id="btn_envoyer"/&gt;
              &lt;br /&gt; 
  
          &lt;/fieldset&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>