mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-28 09:19:40 -05:00
Fix messages
- WebcastSocialMessage - ImDeleteMessage
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
package io.github.jwdeveloper.tiktok;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import io.github.jwdeveloper.tiktok.messages.WebcastChatMessage;
|
||||
import io.github.jwdeveloper.tiktok.messages.WebcastGiftMessage;
|
||||
import io.github.jwdeveloper.tiktok.messages.WebcastLikeMessage;
|
||||
import io.github.jwdeveloper.tiktok.common.TikTokBaseTest;
|
||||
import io.github.jwdeveloper.tiktok.messages.*;
|
||||
import org.junit.Test;
|
||||
|
||||
public class ParseMessagesTests extends TikTokBaseTest
|
||||
@@ -11,13 +10,13 @@ public class ParseMessagesTests extends TikTokBaseTest
|
||||
|
||||
|
||||
@Test
|
||||
public void ShouldParseLikeMessage() throws InvalidProtocolBufferException {
|
||||
public void ShouldParseMessageWebcastLikeMessage() throws InvalidProtocolBufferException {
|
||||
var bytes = getFileBytesUtf("LikeMessage.bin");
|
||||
var message = WebcastLikeMessage.parseFrom(bytes);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ShouldParseGiftMessage() throws InvalidProtocolBufferException {
|
||||
public void ShouldParseMessageWebcastGiftMessage() throws InvalidProtocolBufferException {
|
||||
var bytes = getFileBytesUtf("MessageWebcastGiftMessage.bin");
|
||||
var message = WebcastGiftMessage.parseFrom(bytes);
|
||||
}
|
||||
@@ -27,5 +26,16 @@ public class ParseMessagesTests extends TikTokBaseTest
|
||||
var message = WebcastChatMessage.parseFrom(bytes);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ShouldParseMessageWebcastImDeleteMessage() throws InvalidProtocolBufferException {
|
||||
var bytes = getFileBytesUtf("MessageWebcastImDeleteMessage.bin");
|
||||
var message = WebcastImDeleteMessage.parseFrom(bytes);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void ShouldParseMessageWebcastSocialMessage() throws InvalidProtocolBufferException {
|
||||
var bytes = getFileBytesUtf("MessageWebcastSocialMessage.bin");
|
||||
var message = WebcastSocialMessage.parseFrom(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package io.github.jwdeveloper.tiktok;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import io.github.jwdeveloper.tiktok.common.TikTokBaseTest;
|
||||
import io.github.jwdeveloper.tiktok.events.messages.*;
|
||||
import io.github.jwdeveloper.tiktok.handlers.TikTokEventHandler;
|
||||
import io.github.jwdeveloper.tiktok.handlers.WebResponseHandler;
|
||||
import io.github.jwdeveloper.tiktok.messages.WebcastResponse;
|
||||
import io.github.jwdeveloper.tiktok.messages.WebcastSocialMessage;
|
||||
import io.github.jwdeveloper.tiktok.models.SocialTypes;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
public class WebResponseHandlerTests extends TikTokBaseTest
|
||||
{
|
||||
public static WebResponseHandler sut;
|
||||
|
||||
@Before
|
||||
public void before()
|
||||
{
|
||||
var mockEventHandler = mock(TikTokEventHandler.class);
|
||||
var mockGiftManager = mock(TikTokGiftManager.class);
|
||||
sut = new WebResponseHandler(mockEventHandler, mockGiftManager);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package io.github.jwdeveloper.tiktok;
|
||||
package io.github.jwdeveloper.tiktok.common;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import io.github.jwdeveloper.tiktok.messages.WebcastWebsocketMessage;
|
||||
Reference in New Issue
Block a user