-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ton web #309
Comments
{ Headers { |
|
{ Headers { |
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class QueryParserTest {
@Test
public void testQueryParser() {
String input = "Amount: \"201057993\"\n" +
"QueryId: 702837699428045\n" +
"Step:\n" +
" Params:\n" +
" KindOut: false\n" +
" Limit: \"401857633816219\"\n" +
" Next: null\n" +
" PoolAddr: 0:231324b5b22cfb8307237fde6c8333520ee5a96b3f365e08264c2b2a86271ac1\n" +
"SwapParams:\n" +
" Deadline: 1724087188\n" +
" FulfillPayload: null\n" +
" RecipientAddr: 0:4818f679ede118884806590b9b705a00fa6aa0cf7009d4b3d128ff263b031c88\n" +
" ReferralAddr: 0:d9949a2b4a80787112796fc82dd2a4786e42dfcd50d55dee5298c3dc125d1304\n" +
" RejectPayload: null";
String[] lines = input.split("\n");
String amount = "";
String queryId = "";
for (String line : lines) {
if (line.startsWith("Amount:")) {
amount = line.substring(line.indexOf("\"") + 1, line.lastIndexOf("\""));
} else if (line.startsWith("QueryId:")) {
queryId = line.substring(line.indexOf(":") + 2);
}
}
assertEquals("201057993", amount);
assertEquals("702837699428045", queryId);
}
} |
No description provided.
The text was updated successfully, but these errors were encountered: