From 5f07c7667dc91b6c90a50ecef529a0c4866dfbf1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 15:21:44 -0800 Subject: [PATCH 1/2] Bump codecov/codecov-action from 5.1.2 to 5.3.1 (#560) --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f6aa9bc2f..82cc7de83 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,7 +62,7 @@ jobs: run: ./mvnw -B -q -ff -ntp test - name: Publish code coverage if: ${{ matrix.release_build && github.event_name != 'pull_request' }} - uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 + uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 with: token: ${{ secrets.CODECOV_TOKEN }} file: ./target/site/jacoco/jacoco.xml From fc0db0ff3c9db1cd22e055b4bb136606e9ed236c Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Thu, 30 Jan 2025 20:05:08 -0800 Subject: [PATCH 2/2] Minor test clean up --- .../dataformat/protobuf/BigNumPair.java | 12 -------- .../dataformat/protobuf/SerDeserLongTest.java | 29 ++++++++++++------- 2 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/BigNumPair.java diff --git a/protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/BigNumPair.java b/protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/BigNumPair.java deleted file mode 100644 index d73029bb2..000000000 --- a/protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/BigNumPair.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.fasterxml.jackson.dataformat.protobuf; - -public class BigNumPair { - public static final String protobuf_str = - "message BigNumPair {\n" - + " required int64 long1 = 1;\n" - + " required int64 long2 = 2;\n" - + "}\n"; - - public long long1; - public long long2; -} diff --git a/protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/SerDeserLongTest.java b/protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/SerDeserLongTest.java index 9d307ff61..0f4450a9e 100644 --- a/protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/SerDeserLongTest.java +++ b/protobuf/src/test/java/com/fasterxml/jackson/dataformat/protobuf/SerDeserLongTest.java @@ -1,20 +1,29 @@ package com.fasterxml.jackson.dataformat.protobuf; -import java.io.IOException; - import org.junit.jupiter.api.Test; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.protobuf.schema.ProtobufSchema; import com.fasterxml.jackson.dataformat.protobuf.schema.ProtobufSchemaLoader; -/** - * Created by miz on 8/10/16. - */ -public class SerDeserLongTest { +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class SerDeserLongTest extends ProtobufTestBase +{ + public static class BigNumPair { + public static final String protobuf_str = + "message BigNumPair {\n" + + " required int64 long1 = 1;\n" + + " required int64 long2 = 2;\n" + + "}\n"; + + public long long1; + public long long2; + } + @Test - public void testWeirdLongSerDeser() throws IOException { - ObjectMapper mapper = new ObjectMapper(new ProtobufFactory()); + public void testWeirdLongSerDeser() throws Exception { + ObjectMapper mapper = newObjectMapper(); ProtobufSchema schema = ProtobufSchemaLoader.std.parse(BigNumPair.protobuf_str); BigNumPair bnp = new BigNumPair(); @@ -25,7 +34,7 @@ public void testWeirdLongSerDeser() throws IOException { BigNumPair parsed = mapper.readerFor(BigNumPair.class).with(schema).readValue(encoded); - assert parsed.long1 == bnp.long1; - assert parsed.long2 == bnp.long2; + assertEquals(bnp.long1, parsed.long1); + assertEquals(bnp.long2, parsed.long2); } }