MultiParts { public static void putMetaDatas(Map<String, Object> metadatas, String contentType, String fileName){ metadatas.put(MULTIPART_FLAG, true); if(isNotBlank(contentType)) { metadatas.put(CONTENT_TYPE, contentType); } if(isNotBlank(fileName)) { metadatas.put(FILENAME, fileName); } } private  MultiParts(); static String getContentType(ParamConfig paramConfig); static String getFileName(ParamConfig paramConfig); static String getContentType(Param param); static String getFileName(Param param); static boolean hasMultiPart(ParamConfig[] paramConfigs); static boolean hasMultiPart(Map<String,Object> metadatas); static boolean hasMultiPart(Param param); static void putMetaDatas(Map<String, Object> metadatas, String contentType, String fileName); static Map<String,Object> toMetaDatas(String contentType, String fileName); static void asMultipart(Map<String, Object> metadatas);  }
@Test public void putMetaDatasShouldAddMetaDataIntoGivenMap(){ Map<String,Object> metaDatas = new HashMap<String, Object>(); MultiParts.putMetaDatas(metaDatas, "contentType", "fileName"); assertEquals("contentType", metaDatas.get("multipart.content-type")); assertEquals("fileName", metaDatas.get("multipart.filename")); assertTrue((Boolean)metaDatas.get("multipart.flag")); }