Skip to content

Commit

Permalink
Update dependency com.squareup.okhttp3:mockwebserver3-junit5 to v5.0.…
Browse files Browse the repository at this point in the history
…0-alpha.12 (#190)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Roberto Cella <[email protected]>
  • Loading branch information
renovate[bot] and rob93c authored Dec 17, 2023
1 parent 3c2f05f commit ed901a4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ junit = "org.junit.jupiter:junit-jupiter:5.10.1"
junit-platform = "org.junit.platform:junit-platform-launcher:1.10.1"
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
logback-core = { module = "ch.qos.logback:logback-core", version.ref = "logback" }
mockwebserver = "com.squareup.okhttp3:mockwebserver3-junit5:5.0.0-alpha.11"
mockwebserver = "com.squareup.okhttp3:mockwebserver3-junit5:5.0.0-alpha.12"
okio = "com.squareup.okio:okio:3.7.0"
slf4j-api = "org.slf4j:slf4j-api:2.0.9"
telegram-bot-api = "com.github.pengrad:java-telegram-bot-api:6.9.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public final class MockResponses {

static final MockResponse START_MESSAGE = new MockResponse().setBody("""
static final MockResponse START_MESSAGE = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -25,9 +25,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse HELP_MESSAGE = new MockResponse().setBody("""
static final MockResponse HELP_MESSAGE = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -44,9 +44,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse FILE_NOT_SUPPORTED = new MockResponse().setBody("""
static final MockResponse FILE_NOT_SUPPORTED = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -65,9 +65,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse FILE_TOO_BIG = new MockResponse().setBody("""
static final MockResponse FILE_TOO_BIG = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -87,9 +87,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse ANIMATED_STICKER = new MockResponse().setBody("""
static final MockResponse ANIMATED_STICKER = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -109,9 +109,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse PNG_FILE = new MockResponse().setBody("""
static final MockResponse PNG_FILE = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -131,9 +131,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse WEBP_FILE = new MockResponse().setBody("""
static final MockResponse WEBP_FILE = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -153,9 +153,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse MOV_FILE = new MockResponse().setBody("""
static final MockResponse MOV_FILE = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -175,9 +175,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse WEBM_FILE = new MockResponse().setBody("""
static final MockResponse WEBM_FILE = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -197,9 +197,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse GIF_FILE = new MockResponse().setBody("""
static final MockResponse GIF_FILE = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -219,9 +219,9 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static final MockResponse DOCUMENT = new MockResponse().setBody("""
static final MockResponse DOCUMENT = new MockResponse.Builder().body("""
{
ok: true,
result: [{
Expand All @@ -241,24 +241,24 @@ public final class MockResponses {
}
}]
}
""");
""").build();

static MockResponse fileInfo(String id) {
return new MockResponse().setBody("""
return new MockResponse.Builder().body("""
{
ok: true,
result: {
file_id: "%s",
file_path: "%s"
}
}
""".formatted(id, id));
""".formatted(id, id)).build();
}

static MockResponse fileDownload(File file) throws Exception {
try (var buffer = new Buffer(); var source = Okio.source(file)) {
buffer.writeAll(source);
return new MockResponse().setBody(buffer);
return new MockResponse.Builder().body(buffer).build();
}
}

Expand Down

0 comments on commit ed901a4

Please sign in to comment.