Skip to content

Commit 9c0be85

Browse files
authored
Merge pull request #433 from kazuki-ma/endpoint
FIX [BUG] LineBlobClient is not using the new endpoint.
2 parents 6dc38c3 + b46957a commit 9c0be85

File tree

2 files changed

+68
-3
lines changed

2 files changed

+68
-3
lines changed

line-bot-api-client/src/main/java/com/linecorp/bot/client/LineBlobClientBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ public class LineBlobClientBuilder {
5757
/**
5858
* API Endpoint.
5959
*
60-
* <p>Default value = "https://api.line.me/".
60+
* <p>Default value = "https://api-data.line.me/".
6161
*/
62-
private URI apiEndPoint = LineClientConstants.DEFAULT_API_END_POINT;
62+
private URI apiEndPoint = LineClientConstants.DEFAULT_BLOB_END_POINT;
6363

6464
/**
6565
* API Endpoint.
@@ -74,7 +74,7 @@ public LineBlobClientBuilder apiEndPoint(String apiEndPoint) {
7474
/**
7575
* API Endpoint.
7676
*
77-
* <p>Default value = "https://api.line.me/".
77+
* <p>Default value = "https://api-data.line.me/".
7878
*/ // We can remove this after delete `setApiEndPoint(String apiEndPoint)`.
7979
public LineBlobClientBuilder apiEndPoint(URI apiEndPoint) {
8080
this.apiEndPoint = requireNonNull(apiEndPoint, "apiEndPoint");
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Copyright 2020 LINE Corporation
3+
*
4+
* LINE Corporation licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
package com.linecorp.bot.client;
18+
19+
import static org.assertj.core.api.Assertions.assertThat;
20+
21+
import java.lang.reflect.Field;
22+
import java.net.URI;
23+
24+
import org.junit.Test;
25+
26+
public class LineClientBuildersTest {
27+
@Test
28+
public void testLineBlobClientBuilder() throws Exception {
29+
// Do
30+
final LineBlobClientBuilder defaultBuilder = new LineBlobClientBuilder();
31+
final Field field = defaultBuilder.getClass().getDeclaredField("apiEndPoint");
32+
field.setAccessible(true);
33+
final Object apiEndPoint = field.get(defaultBuilder);
34+
35+
// Verify
36+
assertThat(apiEndPoint)
37+
.isEqualTo(URI.create("https://api-data.line.me/"));
38+
}
39+
40+
@Test
41+
public void testLineMessagingClientBuilder() throws Exception {
42+
// Do
43+
final LineMessagingClientBuilder defaultBuilder = new LineMessagingClientBuilder();
44+
final Field field = defaultBuilder.getClass().getDeclaredField("apiEndPoint");
45+
field.setAccessible(true);
46+
final Object apiEndPoint = field.get(defaultBuilder);
47+
48+
// Verify
49+
assertThat(apiEndPoint)
50+
.isEqualTo(URI.create("https://api.line.me/"));
51+
}
52+
53+
@Test
54+
public void testChannelManagementClientBuilder() throws Exception {
55+
// Do
56+
final ChannelManagementClientBuilder defaultBuilder = new ChannelManagementClientBuilder();
57+
final Field field = defaultBuilder.getClass().getDeclaredField("apiEndPoint");
58+
field.setAccessible(true);
59+
final Object apiEndPoint = field.get(defaultBuilder);
60+
61+
// Verify
62+
assertThat(apiEndPoint)
63+
.isEqualTo(URI.create("https://api.line.me/"));
64+
}
65+
}

0 commit comments

Comments
 (0)