Skip to content

Commit b0af993

Browse files
authored
Remove deprecated methods. (#562)
1 parent 204e4c0 commit b0af993

File tree

68 files changed

+92
-572
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+92
-572
lines changed

line-bot-api-client/src/integrationTest/java/com/linecorp/bot/client/LineOAuthClientIntegrationTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static org.assertj.core.api.Assumptions.assumeThat;
2121

2222
import java.io.IOException;
23+
import java.net.URI;
2324
import java.net.URL;
2425
import java.security.KeyFactory;
2526
import java.security.PrivateKey;
@@ -66,7 +67,7 @@ public void setUp() throws IOException {
6667
endpoint = (String) map.get("endpoint");
6768
target = LineOAuthClient
6869
.builder()
69-
.apiEndPoint(endpoint)
70+
.apiEndPoint(URI.create(endpoint))
7071
.build();
7172

7273
pemPrivateKey = ((String) map.get("pemPrivateKey")).replaceAll("\n", "");

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ public class LineBlobClientBuilder {
6161
*/
6262
private URI apiEndPoint = LineClientConstants.DEFAULT_BLOB_END_POINT;
6363

64-
/**
65-
* API Endpoint.
66-
*
67-
* @deprecated use {@link #apiEndPoint(URI)}.
68-
*/
69-
@Deprecated
70-
public LineBlobClientBuilder apiEndPoint(String apiEndPoint) {
71-
return apiEndPoint(URI.create(apiEndPoint));
72-
}
73-
7464
/**
7565
* API Endpoint.
7666
*

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

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,6 @@ public interface LineMessagingClient {
108108
*/
109109
CompletableFuture<NarrowcastProgressResponse> getNarrowcastProgress(String requestId);
110110

111-
/**
112-
* Download image, video, and audio data sent from users.
113-
*
114-
* @see <a href="https://developers.line.me/en/reference/messaging-api/#get-content">//developers.line.me/en/reference/messaging-api/#get-content</a>
115-
* @deprecated use {@link LineBlobClient} instead.
116-
*/
117-
@Deprecated
118-
CompletableFuture<MessageContentResponse> getMessageContent(String messageId);
119-
120111
/**
121112
* Gets the target limit for additional messages in the current month. The number of messages retrieved by
122113
* this operation includes the number of messages sent from LINE Official Account Manager.
@@ -315,25 +306,6 @@ public interface LineMessagingClient {
315306
*/
316307
CompletableFuture<BotApiResponse> unlinkRichMenuIdFromUsers(List<String> userIds);
317308

318-
/**
319-
* Download rich menu image.
320-
*
321-
* @see <a href="https://developers.line.me/en/docs/messaging-api/reference/#download-rich-menu-image">//developers.line.me/en/docs/messaging-api/reference/#download-rich-menu-image</a>
322-
* @deprecated use {@link LineBlobClient} instead.
323-
*/
324-
@Deprecated
325-
CompletableFuture<MessageContentResponse> getRichMenuImage(String richMenuId);
326-
327-
/**
328-
* Set RichMenu image.
329-
*
330-
* @see <a href="https://developers.line.me/en/docs/messaging-api/reference/#upload-rich-menu-image">//developers.line.me/en/docs/messaging-api/reference/#upload-rich-menu-image</a>
331-
* @deprecated use {@link LineBlobClient} instead.
332-
*/
333-
@Deprecated
334-
CompletableFuture<BotApiResponse> setRichMenuImage(
335-
String richMenuId, String contentType, byte[] content);
336-
337309
/**
338310
* Gets a list of all uploaded rich menus.
339311
*

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@ public class LineMessagingClientBuilder {
6464
*/
6565
private URI apiEndPoint = LineClientConstants.DEFAULT_API_END_POINT;
6666

67-
/**
68-
* API Endpoint.
69-
*
70-
* @deprecated use {@link #apiEndPoint(URI apiEndPoint)}.
71-
*/
72-
@Deprecated
73-
public LineMessagingClientBuilder apiEndPoint(String apiEndPoint) {
74-
return apiEndPoint(URI.create(apiEndPoint));
75-
}
76-
7767
/**
7868
* API Endpoint.
7969
*

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,6 @@ public CompletableFuture<NarrowcastProgressResponse> getNarrowcastProgress(Strin
105105
}
106106

107107
@Override
108-
@SuppressWarnings("deprecation")
109-
public CompletableFuture<MessageContentResponse> getMessageContent(String messageId) {
110-
return blobDelegationTarget.getMessageContent(messageId);
111-
}
112-
113-
@Override
114-
@SuppressWarnings("deprecation")
115108
public CompletableFuture<MessageQuotaResponse> getMessageQuota() {
116109
return toFuture(retrofitImpl.getMessageQuota());
117110
}
@@ -241,19 +234,6 @@ public CompletableFuture<BotApiResponse> unlinkRichMenuIdFromUsers(List<String>
241234
.build()));
242235
}
243236

244-
@Override
245-
@SuppressWarnings("deprecation")
246-
public CompletableFuture<MessageContentResponse> getRichMenuImage(final String richMenuId) {
247-
return blobDelegationTarget.getRichMenuImage(richMenuId);
248-
}
249-
250-
@Override
251-
@SuppressWarnings("deprecation")
252-
public CompletableFuture<BotApiResponse> setRichMenuImage(
253-
final String richMenuId, final String contentType, final byte[] content) {
254-
return blobDelegationTarget.setRichMenuImage(richMenuId, contentType, content);
255-
}
256-
257237
@Override
258238
public CompletableFuture<RichMenuListResponse> getRichMenuList() {
259239
return toFuture(retrofitImpl.getRichMenuList());

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@ public class LineOAuthClientBuilder {
5959
*/
6060
private URI apiEndPoint = LineClientConstants.DEFAULT_API_END_POINT;
6161

62-
/**
63-
* API Endpoint.
64-
*
65-
* @deprecated use {@link #apiEndPoint(URI apiEndPoint)}.
66-
*/
67-
@Deprecated
68-
public LineOAuthClientBuilder apiEndPoint(String apiEndPoint) {
69-
return apiEndPoint(URI.create(apiEndPoint));
70-
}
71-
7262
/**
7363
* API Endpoint.
7464
*

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,6 @@ public class ManageAudienceClientBuilder {
6161
*/
6262
private URI apiEndPoint = LineClientConstants.DEFAULT_API_END_POINT;
6363

64-
/**
65-
* API Endpoint.
66-
*
67-
* @deprecated use {@link #apiEndPoint(URI apiEndPoint)}.
68-
*/
69-
@Deprecated
70-
public ManageAudienceClientBuilder apiEndPoint(String apiEndPoint) {
71-
return apiEndPoint(URI.create(apiEndPoint));
72-
}
73-
7464
/**
7565
* API Endpoint.
7666
*

line-bot-api-client/src/test/java/com/linecorp/bot/client/LineMessagingClientBuilderTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import static org.assertj.core.api.Assertions.assertThat;
2020
import static org.assertj.core.api.Assertions.assertThatThrownBy;
2121

22+
import java.net.URI;
23+
2224
import org.junit.Rule;
2325
import org.junit.Test;
2426
import org.mockito.junit.MockitoJUnit;
@@ -34,7 +36,7 @@ public class LineMessagingClientBuilderTest extends AbstractWiremockTest {
3436
public void testBuildWithFixedToken() throws InterruptedException {
3537
lineMessagingClient = new LineMessagingClientBuilder()
3638
.channelToken("MOCKED_TOKEN")
37-
.apiEndPoint("http://localhost:" + mockWebServer.getPort())
39+
.apiEndPoint(URI.create("http://localhost:" + mockWebServer.getPort()))
3840
.build();
3941

4042
// Do
@@ -50,7 +52,7 @@ public void testBuildWithFixedToken() throws InterruptedException {
5052
public void testBuilderWithChannelTokenSupplier() throws InterruptedException {
5153
lineMessagingClient =
5254
LineMessagingClient.builder(() -> "MOCKED_TOKEN")
53-
.apiEndPoint("http://localhost:" + mockWebServer.getPort())
55+
.apiEndPoint(URI.create("http://localhost:" + mockWebServer.getPort()))
5456
.build();
5557

5658
// Do

line-bot-api-client/src/test/java/com/linecorp/bot/client/LineMessagingClientTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void setUp() throws Exception {
5050
+ "/CanContainsRelative/";
5151
target = LineMessagingClient
5252
.builder("SECRET")
53-
.apiEndPoint(apiEndPoint)
53+
.apiEndPoint(URI.create(apiEndPoint))
5454
.build();
5555
}
5656

line-bot-api-client/src/test/java/com/linecorp/bot/client/LineOAuthClientTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.assertj.core.api.Assertions.assertThat;
2020
import static org.assertj.core.api.AssertionsForClassTypes.catchThrowableOfType;
2121

22+
import java.net.URI;
2223
import java.util.concurrent.CompletionException;
2324

2425
import org.junit.After;
@@ -60,7 +61,7 @@ public void setUp() {
6061
mockWebServer = new MockWebServer();
6162
final String apiEndPoint = mockWebServer.url("/").toString();
6263
target = LineOAuthClient.builder()
63-
.apiEndPoint(apiEndPoint)
64+
.apiEndPoint(URI.create(apiEndPoint))
6465
.build();
6566
}
6667

0 commit comments

Comments
 (0)