From 0984aedbce59b6b70a58cd4d97a192e95dfb9e7f Mon Sep 17 00:00:00 2001 From: "SYBIT\\ssr" Date: Thu, 4 Jul 2019 13:53:58 +0200 Subject: [PATCH] bump versions of used libs --- build.gradle | 13 ++-- .../airtable/CustomObjectMapperTest.java | 72 +++++++++---------- 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/build.gradle b/build.gradle index 34485fe..44910ed 100644 --- a/build.gradle +++ b/build.gradle @@ -91,17 +91,16 @@ configurations { dependencies { compile group: 'com.mashape.unirest', name: 'unirest-java', version:'1.4.9' - compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.3' + compile group: 'org.apache.httpcomponents', name: 'httpclient', version:'4.5.9' compile group: 'org.json', name: 'json', version:'20160810' - compile group: 'com.google.code.gson', name: 'gson', version:'2.8.0' + compile group: 'com.google.code.gson', name: 'gson', version:'2.8.5' compile group: 'commons-beanutils', name: 'commons-beanutils', version:'1.9.3' - compile group: 'commons-io', name: 'commons-io', version:'2.5' - compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.25' + compile group: 'commons-io', name: 'commons-io', version:'2.6' + compile group: 'org.slf4j', name: 'slf4j-api', version:'1.7.26' testCompile group: 'junit', name: 'junit', version:'4.12' - testCompile group: 'commons-io', name: 'commons-io', version:'2.5' - testCompile group: 'com.github.tomakehurst', name: 'wiremock', version:'2.8.0' - testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version:'1.7.25' + testCompile group: 'com.github.tomakehurst', name: 'wiremock', version:'2.23.2' + testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version:'1.7.26' codacy group: 'com.codacy', name: 'codacy-coverage-reporter', version: '1.0.13' } diff --git a/src/test/java/com/sybit/airtable/CustomObjectMapperTest.java b/src/test/java/com/sybit/airtable/CustomObjectMapperTest.java index f8b299d..8d840e4 100644 --- a/src/test/java/com/sybit/airtable/CustomObjectMapperTest.java +++ b/src/test/java/com/sybit/airtable/CustomObjectMapperTest.java @@ -12,9 +12,9 @@ import com.sybit.airtable.vo.Attachment; import com.sybit.airtable.vo.Thumbnail; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.collections4.map.HashedMap; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Before; @@ -25,61 +25,61 @@ * @author fzr */ public class CustomObjectMapperTest { - + private ListConverter listConverter; private MapConverter mapConverter; - + @Before public void before(){ - + this.listConverter = new ListConverter(); this.mapConverter = new MapConverter(); - + } - + @Test public void listClassTest(){ - + listConverter.setListClass(Attachment.class); - assertEquals(listConverter.getListClass(),Attachment.class); + assertEquals(listConverter.getListClass(),Attachment.class); } - - @Test + + @Test public void mapClassTest(){ - + mapConverter.setMapClass(Thumbnail.class); assertEquals(mapConverter.getMapClass(),Thumbnail.class); } - + @Test public void convertListTest(){ - + listConverter.setListClass(Attachment.class); - + Class type = List.class; List value = new ArrayList(); - + LinkedTreeMap ltm = new LinkedTreeMap(); ltm.put("id","id0001"); ltm.put("url","http://test.com"); ltm.put("filename","filename.txt"); ltm.put("size","10"); ltm.put("type","image/jpeg"); - - Map thumbnails = new HashedMap<>(); + + Map thumbnails = new HashMap<>(); Thumbnail tmb = new Thumbnail(); - + tmb.setName("Thumbnail"); tmb.setUrl("http:example.com"); tmb.setWidth(Float.valueOf(10)); tmb.setHeight(Float.valueOf(10)); - + thumbnails.put("small", tmb); - + ltm.put("thumbnails",thumbnails); - + value.add(0, ltm); - + List list = (List) listConverter.convert(type, value); assertNotNull(list); assertNotNull(list.get(0).getId()); @@ -87,32 +87,32 @@ public void convertListTest(){ assertNotNull(list.get(0).getSize()); assertNotNull(list.get(0).getType()); assertNotNull(list.get(0).getUrl()); - assertNotNull(list.get(0).getThumbnails()); - + assertNotNull(list.get(0).getThumbnails()); + } - + @Test public void convertMapTest(){ - + mapConverter.setMapClass(Thumbnail.class); - + Class type = Map.class; - + LinkedTreeMap value = new LinkedTreeMap<>(); LinkedTreeMap innerMap = new LinkedTreeMap<>(); - + innerMap.put("url","http://example.com"); - value.put("small",innerMap); - - + value.put("small",innerMap); + + Map thumb = (Map) mapConverter.convert(type,value); System.out.println(thumb); assertNotNull(thumb); assertNotNull(thumb.get("small")); assertNotNull(thumb.get("small").getUrl()); - - - + + + } - + }