embulk-input-zendesk 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d972c5116a66a8dab7e295a806f977bc1cbcf1f5
4
- data.tar.gz: f51b015c3bfc0e62093b2bb83b78781a5fd22afc
3
+ metadata.gz: ad84ae4662ea53d03acc90bfa8bb64fa4cbc7d1c
4
+ data.tar.gz: 64c1ca4a49feb32bc0ee301516462380a4b07e62
5
5
  SHA512:
6
- metadata.gz: cfee244009630fcff30c4a3ced32729b451e9a88b3f889efc281fbdcf6f671e2f1aa80e094fe1af3cd40b8683f1cc1e0f210b847bc662e43d4737e7619d33af2
7
- data.tar.gz: d23006d4502f46397ffd406813e55a08532cdf6f6cb6d86ab564240edea303f1b81082c6cd33c11d5870168acf8b5e882ec7168e1c8bdb95f3d58b4e7e535dc9
6
+ metadata.gz: 746eb9f61b8ec5bd2e9fd4708524cfb0736a3fa37f1869a2fdcfe69a766f7b022a302ca519514ff8bbb84074d84927042910bf58e298ce4c176fb69f02093fb9
7
+ data.tar.gz: f83290a54accc3a198507d3db5d111cb2f852d72d5000745846a4131d20a99ea94dd6f2a5aa5c2d87174a04131a2ee814c2b079e7092e2b6510e81e2de0fe952
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.3.3 - 2019-04-11
2
+ * [fixed] Fix trailing slash #55 [#55](https://github.com/treasure-data/embulk-input-zendesk/pull/55)
3
+
1
4
  ## 0.3.2 - 2019-04-10
2
5
  * [fixed] Fix generate config diff based on incremental config #54 [#54](https://github.com/treasure-data/embulk-input-zendesk/pull/54)
3
6
 
data/build.gradle CHANGED
@@ -15,7 +15,7 @@ configurations {
15
15
  provided
16
16
  }
17
17
 
18
- version = "0.3.2"
18
+ version = "0.3.3"
19
19
 
20
20
  sourceCompatibility = 1.8
21
21
  targetCompatibility = 1.8
@@ -423,7 +423,9 @@ public class ZendeskInputPlugin implements InputPlugin
423
423
  // FIXME: if include is not contained in schema, data should be ignore
424
424
  task.getIncludes().forEach(include -> {
425
425
  String relatedObjectName = include.trim();
426
- final String url = task.getLoginUrl() + ZendeskConstants.Url.API
426
+ final String url = task.getLoginUrl()
427
+ + "/"
428
+ + ZendeskConstants.Url.API
427
429
  + "/" + task.getTarget().toString()
428
430
  + "/" + jsonNode.get(ZendeskConstants.Field.ID).asText()
429
431
  + "/" + relatedObjectName + ".json";
@@ -86,6 +86,7 @@ public class ZendeskSupportAPIService
86
86
  boolean isSupportIncremental = ZendeskUtils.isSupportAPIIncremental(task.getTarget());
87
87
 
88
88
  StringBuilder urlBuilder = new StringBuilder(task.getLoginUrl())
89
+ .append("/")
89
90
  .append(isSupportIncremental
90
91
  ? ZendeskConstants.Url.API_INCREMENTAL
91
92
  : ZendeskConstants.Url.API)
@@ -49,7 +49,6 @@ public class ZendeskConstants
49
49
  public static class Regex
50
50
  {
51
51
  public static final String ID = "_id$";
52
- public static final String HOST = "^(https:\\/\\/)?(www.)?([a-zA-Z0-9]+).zendesk.com/$";
53
52
  }
54
53
 
55
54
  public static class HttpStatus
@@ -6,9 +6,6 @@ import org.embulk.input.zendesk.services.ZendeskSupportAPIService;
6
6
  import org.embulk.spi.Exec;
7
7
  import org.slf4j.Logger;
8
8
 
9
- import java.util.regex.Matcher;
10
- import java.util.regex.Pattern;
11
-
12
9
  public class ZendeskValidatorUtils
13
10
  {
14
11
  private ZendeskValidatorUtils(){}
@@ -17,7 +14,6 @@ public class ZendeskValidatorUtils
17
14
 
18
15
  public static void validateInputTask(final ZendeskInputPlugin.PluginTask task, final ZendeskSupportAPIService zendeskSupportAPIService)
19
16
  {
20
- validateHost(task.getLoginUrl());
21
17
  validateAppMarketPlace(task.getAppMarketPlaceIntegrationName().isPresent(),
22
18
  task.getAppMarketPlaceAppId().isPresent(),
23
19
  task.getAppMarketPlaceOrgId().isPresent());
@@ -25,15 +21,6 @@ public class ZendeskValidatorUtils
25
21
  validateIncremental(task);
26
22
  }
27
23
 
28
- private static void validateHost(final String loginUrl)
29
- {
30
- final Matcher matcher = Pattern.compile(ZendeskConstants.Regex.HOST).matcher(loginUrl);
31
- if (!matcher.matches()) {
32
- throw new ConfigException(String.format("Login URL, '%s', is unmatched expectation. " +
33
- "It should be followed this format: https://abc.zendesk.com/", loginUrl));
34
- }
35
- }
36
-
37
24
  private static void validateCredentials(final ZendeskInputPlugin.PluginTask task)
38
25
  {
39
26
  switch (task.getAuthenticationMethod()) {
@@ -44,14 +44,6 @@ public class TestZendeskValidatorUtils
44
44
  configSource = getBaseConfigSource();
45
45
  }
46
46
 
47
- @Test
48
- public void validateHostShouldThrowException()
49
- {
50
- configSource.set("login_url", "dummyhost");
51
- final ZendeskInputPlugin.PluginTask task = configSource.loadConfig(ZendeskInputPlugin.PluginTask.class);
52
- assertValidation(task, "Login URL, 'dummyhost', is unmatched expectation. It should be followed this format: https://abc.zendesk.com/");
53
- }
54
-
55
47
  @Test
56
48
  public void validateCredentialOauthShouldThrowException()
57
49
  {
@@ -1,5 +1,5 @@
1
1
  type: zendesk
2
- login_url: https://abc.zendesk.com/
2
+ login_url: https://abc.zendesk.com
3
3
  auth_method: oauth
4
4
  username: dummy
5
5
  password: dummy
@@ -1,5 +1,5 @@
1
1
  type: zendesk
2
- login_url: https://abc.zendesk.com/
2
+ login_url: https://abc.zendesk.com
3
3
  auth_method: oauth
4
4
  username: dummy
5
5
  password: dummy
@@ -1,5 +1,5 @@
1
1
  type: zendesk
2
- login_url: https://abc.zendesk.com/
2
+ login_url: https://abc.zendesk.com
3
3
  auth_method: oauth
4
4
  username: dummy
5
5
  password: dummy
@@ -1,5 +1,5 @@
1
1
  type: zendesk
2
- login_url: https://abc.zendesk.com/
2
+ login_url: https://abc.zendesk.com
3
3
  auth_method: oauth
4
4
  username: dummy
5
5
  password: dummy
@@ -1,5 +1,5 @@
1
1
  type: zendesk
2
- login_url: https://abc.zendesk.com/
2
+ login_url: https://abc.zendesk.com
3
3
  auth_method: oauth
4
4
  username: dummy
5
5
  password: dummy
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-zendesk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - hieu.duong
@@ -95,8 +95,8 @@ files:
95
95
  - src/test/resources/data/tickets_continue.json
96
96
  - src/test/resources/data/util.json
97
97
  - src/test/resources/data/util_page.json
98
- - classpath/embulk-input-zendesk-0.3.2.jar
99
98
  - classpath/commons-logging-1.2.jar
99
+ - classpath/embulk-input-zendesk-0.3.3.jar
100
100
  - classpath/httpcore-4.4.10.jar
101
101
  - classpath/httpclient-4.5.6.jar
102
102
  - classpath/commons-codec-1.10.jar