File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
test/java/com/cloudinary/analytics Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ public String generate(String source) {
418418 } catch (MalformedURLException ignored ) {
419419 }
420420 }
421- if (cloudinary .config .analytics ) {
421+ if (cloudinary .config .analytics != null && cloudinary . config . analytics ) {
422422 try {
423423 URL tempUrl = new URL (url );
424424 // if any other query param already exist on the URL do not add analytics query param.
Original file line number Diff line number Diff line change @@ -78,17 +78,15 @@ public void testUrlWithNoAnalyticsDefined() {
7878
7979 @ Test
8080 public void testUrlWithNoAnalyticsNull () {
81- cloudinary .analytics = null ;
8281 String url = cloudinary .url ().generate ("test" );
8382 Assert .assertEquals (url , "http://res.cloudinary.com/test123/image/upload/test" );
8483 }
8584
8685 @ Test
8786 public void testUrlWithNoAnalyticsNullAndTrue () {
8887 cloudinary .config .analytics = true ;
89- cloudinary .analytics = null ;
9088 String url = cloudinary .url ().generate ("test" );
91- Assert .assertEquals (url , "http://res.cloudinary.com/test123/image/upload/test" );
89+ Assert .assertEquals (url , "http://res.cloudinary.com/test123/image/upload/test?_a=AGAtVAN0 " );
9290 }
9391
9492 @ Test
You can’t perform that action at this time.
0 commit comments