Skip to content

Add support for @PostMapping("/path") to pub/sub topic subscriptions#583

Merged
dapr-bot merged 15 commits into
dapr:masterfrom
mthmulders:pubsub-binding-postmapping-value
Aug 21, 2021
Merged

Add support for @PostMapping("/path") to pub/sub topic subscriptions#583
dapr-bot merged 15 commits into
dapr:masterfrom
mthmulders:pubsub-binding-postmapping-value

Conversation

@mthmulders

Copy link
Copy Markdown
Contributor

Description

I've updated the DaprBeanPostProcessor class so it supports @PostMapping("/path") like annotations. Also, I've added tests for the DaprBeanPostProcessor class.

Issue reference

This PR will close issue #575.

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@mthmulders mthmulders requested review from a team as code owners July 25, 2021 18:58
@ghost

ghost commented Jul 25, 2021

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@artursouza artursouza left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this pull request. Please, move the integration test to the sdk-tests package - see how there is a way we designed to write those already. So, org.assertj dependency should be removed too.

Comment thread sdk-springboot/src/test/java/io/dapr/springboot/DaprBeanPostProcessorIT.java Outdated
@mthmulders mthmulders force-pushed the pubsub-binding-postmapping-value branch from eb9ac30 to 1628257 Compare July 28, 2021 19:23
@artursouza

artursouza commented Aug 10, 2021

Copy link
Copy Markdown
Contributor

The integration test code is not in the PR yet. I will give it another look afterwards. Thanks.

@mthmulders

Copy link
Copy Markdown
Contributor Author

The integration test code is not in the PR yet. I will give it another look afterwards. Thanks.

I've already updated sdk-tests/src/test/java/io/dapr/it/pubsub/http/SubscriberController.java: one out of the many @PostMapping annotated methods there no longer specifies the path argument. All tests that depend on that controller method are still green, which I would consider a proof that the changes have the intended effect.

If you feel that the changes need more tests, could you please elaborate on what kind of test you'd like to see?

artursouza
artursouza previously approved these changes Aug 14, 2021
@artursouza artursouza self-assigned this Aug 14, 2021
@codecov

codecov Bot commented Aug 21, 2021

Copy link
Copy Markdown

Codecov Report

Merging #583 (b2a1e22) into master (ac93218) will increase coverage by 0.13%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #583      +/-   ##
============================================
+ Coverage     77.03%   77.16%   +0.13%     
- Complexity      941      942       +1     
============================================
  Files            88       88              
  Lines          3009     3009              
  Branches        334      334              
============================================
+ Hits           2318     2322       +4     
+ Misses          528      525       -3     
+ Partials        163      162       -1     
Impacted Files Coverage Δ
sdk/src/main/java/io/dapr/utils/Retry.java 75.00% <0.00%> (+25.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac93218...b2a1e22. Read the comment docs.

@dapr-bot dapr-bot merged commit 3c3a527 into dapr:master Aug 21, 2021
mthmulders added a commit to mthmulders/java-sdk that referenced this pull request Aug 21, 2021
…apr#583)

* Remove duplicate dependency

* Transform into managed dependencies

* Remove old JUnit version from dependencies

* Add tests for DaprBeanPostProcessor

* Also register PostMappings that use value

* Modify existing pub/sub test to no use @PostMapping(path="...")

* Remove added dependencies on AssertJ, Spring Test and Servlet API

* Remove test in favour of the sdk-tests one

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
artursouza added a commit that referenced this pull request Aug 30, 2021
* Upgrade Mockito to latest version

* Run GitHub Actions on Java 11 and 16

* Run JUnit tests with `--add-opens java.base/java.util=ALL-UNNAMED`

* Move Surefire JVM arguments to Maven property

* Update build.yml

* Update validate.yml

* simplily build singleton dapr http (#590)

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>

* Add Automerge workflow (#605)

* Add Automerge workflow

The automerge workflow will check for complete and approved pull requests and will merge them automatically.

Sources:
- For the python script to execute the merge: https://raw.githubusercontent.com/dapr/dapr/master/.github/scripts/automerge.py (only changed the label from "automerge" to "auto-merge")
- https://raw.githubusercontent.com/dapr/dapr/master/.github/workflows/dapr-bot-schedule.yml (only copied the automerge part, not the prune_stale part as that was not part of the issue.

Resolves #603

* Update automerge-bot.yml

* Update automerge-bot.yml

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>

* Cleanup Maven POM files (#604)

Added fixed versions for maven-deploy-plugin & spring-boot-maven-plugin as this would otherwise break in a future maven version.

Also fixed some indenting and removed duplicate declarations.

Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>

* Add support for @PostMapping("/path") to pub/sub topic subscriptions (#583)

* Remove duplicate dependency

* Transform into managed dependencies

* Remove old JUnit version from dependencies

* Add tests for DaprBeanPostProcessor

* Also register PostMappings that use value

* Modify existing pub/sub test to no use @PostMapping(path="...")

* Remove added dependencies on AssertJ, Spring Test and Servlet API

* Remove test in favour of the sdk-tests one

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>

* Run JUnit tests in all modules with java.base/java.util and java.base/java.lang opened to all modules

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: 浩 <inf2inf2@outlook.com>
Co-authored-by: Tom Cools <tom.cools@live.be>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
* Upgrade Mockito to latest version

* Run GitHub Actions on Java 11 and 16

* Run JUnit tests with `--add-opens java.base/java.util=ALL-UNNAMED`

* Move Surefire JVM arguments to Maven property

* Update build.yml

* Update validate.yml

* simplily build singleton dapr http (dapr#590)

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>

* Add Automerge workflow (dapr#605)

* Add Automerge workflow

The automerge workflow will check for complete and approved pull requests and will merge them automatically.

Sources:
- For the python script to execute the merge: https://raw.githubusercontent.com/dapr/dapr/master/.github/scripts/automerge.py (only changed the label from "automerge" to "auto-merge")
- https://raw.githubusercontent.com/dapr/dapr/master/.github/workflows/dapr-bot-schedule.yml (only copied the automerge part, not the prune_stale part as that was not part of the issue.

Resolves dapr#603

* Update automerge-bot.yml

* Update automerge-bot.yml

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>

* Cleanup Maven POM files (dapr#604)

Added fixed versions for maven-deploy-plugin & spring-boot-maven-plugin as this would otherwise break in a future maven version.

Also fixed some indenting and removed duplicate declarations.

Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>

* Add support for @PostMapping("/path") to pub/sub topic subscriptions (dapr#583)

* Remove duplicate dependency

* Transform into managed dependencies

* Remove old JUnit version from dependencies

* Add tests for DaprBeanPostProcessor

* Also register PostMappings that use value

* Modify existing pub/sub test to no use @PostMapping(path="...")

* Remove added dependencies on AssertJ, Spring Test and Servlet API

* Remove test in favour of the sdk-tests one

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>

* Run JUnit tests in all modules with java.base/java.util and java.base/java.lang opened to all modules

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: 浩 <inf2inf2@outlook.com>
Co-authored-by: Tom Cools <tom.cools@live.be>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
…apr#583)

* Remove duplicate dependency

* Transform into managed dependencies

* Remove old JUnit version from dependencies

* Add tests for DaprBeanPostProcessor

* Also register PostMappings that use value

* Modify existing pub/sub test to no use @PostMapping(path="...")

* Remove added dependencies on AssertJ, Spring Test and Servlet API

* Remove test in favour of the sdk-tests one

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
fackee pushed a commit to fackee/java-sdk that referenced this pull request Mar 28, 2022
* Upgrade Mockito to latest version

* Run GitHub Actions on Java 11 and 16

* Run JUnit tests with `--add-opens java.base/java.util=ALL-UNNAMED`

* Move Surefire JVM arguments to Maven property

* Update build.yml

* Update validate.yml

* simplily build singleton dapr http (dapr#590)

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>

* Add Automerge workflow (dapr#605)

* Add Automerge workflow

The automerge workflow will check for complete and approved pull requests and will merge them automatically.

Sources:
- For the python script to execute the merge: https://raw.githubusercontent.com/dapr/dapr/master/.github/scripts/automerge.py (only changed the label from "automerge" to "auto-merge")
- https://raw.githubusercontent.com/dapr/dapr/master/.github/workflows/dapr-bot-schedule.yml (only copied the automerge part, not the prune_stale part as that was not part of the issue.

Resolves dapr#603

* Update automerge-bot.yml

* Update automerge-bot.yml

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>

* Cleanup Maven POM files (dapr#604)

Added fixed versions for maven-deploy-plugin & spring-boot-maven-plugin as this would otherwise break in a future maven version.

Also fixed some indenting and removed duplicate declarations.

Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>

* Add support for @PostMapping("/path") to pub/sub topic subscriptions (dapr#583)

* Remove duplicate dependency

* Transform into managed dependencies

* Remove old JUnit version from dependencies

* Add tests for DaprBeanPostProcessor

* Also register PostMappings that use value

* Modify existing pub/sub test to no use @PostMapping(path="...")

* Remove added dependencies on AssertJ, Spring Test and Servlet API

* Remove test in favour of the sdk-tests one

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>

* Run JUnit tests in all modules with java.base/java.util and java.base/java.lang opened to all modules

Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: 浩 <inf2inf2@outlook.com>
Co-authored-by: Tom Cools <tom.cools@live.be>
Co-authored-by: Dapr Bot <56698301+dapr-bot@users.noreply.github.com>
Signed-off-by: zjx244729 <zjx244729@alibaba-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants