{"id":1395,"date":"2022-03-12T08:06:00","date_gmt":"2022-03-12T15:06:00","guid":{"rendered":"https:\/\/bullyrooks.com\/?p=1395"},"modified":"2022-03-13T17:24:30","modified_gmt":"2022-03-14T00:24:30","slug":"kube-cloud-pt6-update-to-consumer-contract","status":"publish","type":"post","link":"https:\/\/bullyrooks.com\/index.php\/2022\/03\/12\/kube-cloud-pt6-update-to-consumer-contract\/","title":{"rendered":"Kube Cloud Pt6 | Break the Contract from a Consumer Change"},"content":{"rendered":"\n<p>We&#8217;re going to go back to cloud-application at this point and update our client to expect a field that isn&#8217;t being currently provided (message generated date).  This <em>should<\/em> break our contract test and prevent us from deploying, but there&#8217;s some updates we need to make to support this.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Add the New Feature to the Consumer<\/h2>\n\n\n\n<p>Go to the cloud-application project and start a new branch<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ git checkout -b generated-date\nSwitched to a new branch 'generated-date'<\/code><\/pre>\n\n\n\n<p>We&#8217;re using dates, so lets make sure that we have the correct serializers in the <code>pom.xml<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        &lt;!-- dates --&gt;\n        &lt;dependency&gt;\n            &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;\/groupId&gt;\n            &lt;artifactId&gt;jackson-datatype-jsr310&lt;\/artifactId&gt;\n        &lt;\/dependency&gt;<\/code><\/pre>\n\n\n\n<p>And we&#8217;re going to have to fix the logging aspect at <code>src\/main\/java\/com\/bullyrooks\/cloud_application\/config\/LoggingAspect.java<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    ObjectMapper om;\n\n    @Autowired\n    public LoggingAspect() {\n        om = new ObjectMapper()\n                .registerModule(new JavaTimeModule());\n    }<\/code><\/pre>\n\n\n\n<p>Essentially we&#8217;re going to add the java time serialization module to our json object mapper<\/p>\n\n\n\n<p>Make a minor update to <code>src\/main\/resources\/application.yml<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>spring:\n  application:\n    name: cloud-application\n  jackson:\n    serialization:\n      write-dates-as-timestamps: false<\/code><\/pre>\n\n\n\n<p>This is just something I use to make sure that my timestamps are written out correctly, its not directly applicable here, but since we&#8217;re messing with java8 dates, its a safe thing to do<\/p>\n\n\n\n<p>Now add our new field to<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>src\/main\/java\/com\/bullyrooks\/cloud_application\/controller\/dto\/CreateMessageResponseDTO.java<\/code><\/li><li><code>src\/main\/java\/com\/bullyrooks\/cloud_application\/message_generator\/client\/dto\/MessageResponseDTO.java<\/code><\/li><li><code>src\/main\/java\/com\/bullyrooks\/cloud_application\/service\/model\/MessageModel.java<\/code><\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>private Instant generatedDate;\n<\/code><\/pre>\n\n\n\n<p>Add the new date to the test data in <code>src\/test\/resources\/json\/message-generator-response.json<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"message\": \"All dwarfs are bastards in their father's eyes\",\n  \"generatedDate\": \"2022-03-07T18:37:54.124523300Z\"<\/code><\/pre>\n\n\n\n<p>Now we need to make a new mapper at <code>src\/main\/java\/com\/bullyrooks\/cloud_application\/message_generator\/mapper\/MessageGeneratorMapper.java<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.bullyrooks.cloud_application.message_generator.mapper;\n\nimport com.bullyrooks.cloud_application.message_generator.client.dto.MessageResponseDTO;\nimport com.bullyrooks.cloud_application.service.model.MessageModel;\nimport org.mapstruct.Mapper;\nimport org.mapstruct.MappingTarget;\nimport org.mapstruct.factory.Mappers;\n\n@Mapper\npublic interface MessageGeneratorMapper {\n    MessageGeneratorMapper INSTANCE = Mappers.getMapper(MessageGeneratorMapper.class);\n\n    MessageModel messageResponseToMessage(@MappingTarget MessageModel in, MessageResponseDTO dto);\n}<\/code><\/pre>\n\n\n\n<p>And the corresponding updates to the service class at <code>src\/main\/java\/com\/bullyrooks\/cloud_application\/service\/MessageService.java<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>            messageModel = MessageGeneratorMapper.INSTANCE.messageResponseToMessage(messageModel, dto);\n            genMsgSuccess.increment();\n            log.info(\"retrieved message: {}\", messageModel.getMessage());\n        } else {\n            \/\/if they provided a message, return now\n            messageModel.setGeneratedDate(Instant.now());\n        }<\/code><\/pre>\n\n\n\n<p>So instead of copying fields over individually (for <code>message <\/code>and <code>generatedDate<\/code>) the mapper will take in the original message and then add the fields that are missing from the dto object.  If we passed in a message, we want to return a new <code>generatedDate<\/code>.<\/p>\n\n\n\n<p>Now update the behavior test at <code>src\/test\/java\/com\/bullyrooks\/cloud_application\/controller\/MessageControllerTest.java<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    @AfterEach\n    void cleanup(){\n        \/\/cleanup\n        outputDestination.clear(\"message.created\");\n    }\n\n...\n @Test\n    void testSaveMessage() throws IOException {\n        Long userId = 1l;\n\n        \/\/given\n        Instant testStart = Instant.now();\n        CreateMessageRequestDTO request = CreateMessageRequestDTO\n                .builder()\n...\n        assertEquals(request.getMessage(), dto.getMessage());\n        assertTrue(dto.getGeneratedDate().isAfter(testStart));\n...\n@Test\n    void testGetReturnsMessageIfMissing() throws InterruptedException, IOException {\n        Long userId = 1l;\n\n        \/\/given\n        Instant testStart = Instant.now();\n        CreateMessageRequestDTO request = CreateMessageRequestDTO\n                .builder()\n...\n        when(messageGeneratorClient.getMessage()).thenReturn(\n                MessageResponseDTO.builder()\n                .message(faker.gameOfThrones().quote())\n                        .generatedDate(Instant.now())\n                .build());\n...\n        assertTrue(StringUtils.isNotBlank(dto.getMessage()));\n        assertTrue(dto.getGeneratedDate().isAfter(testStart));<\/code><\/pre>\n\n\n\n<p>I&#8217;m adding a cleanup method to the kafka testing logic because I found that if my tests were failing data from the previous test was polluting the topic for the next test.  Next, I&#8217;m adding a &#8216;test start&#8217; date and confirming that the message I get back from the endpoint is after that date.  Additionally, I&#8217;m updating the mock so that it will return a generatedDate field.<\/p>\n\n\n\n<p>Finally the contract test at <code>src\/test\/java\/com\/bullyrooks\/cloud_application\/message_generator\/client\/MessageGeneratorClientTest.java<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>...\n    public void generateMessage() {\n        MessageResponseDTO response = messageGeneratorClient.getMessage();\n        assertTrue(StringUtils.isNotBlank(response.getMessage()));\n        assertTrue(null != response.getGeneratedDate());\n    }\n...<\/code><\/pre>\n\n\n\n<p>No major changes here&#8230; just that I&#8217;m expecting the date that my json is now returning.  Keep in mind that I have to manually update two tests which is what I warned about before.  If I didn&#8217;t update the contract, my tests would pass and I would think that I&#8217;m good to deploy, but I&#8217;m not (message-generator doesn&#8217;t support this functionality yet)<\/p>\n\n\n\n<p>Go ahead and add\/commit and push this up.  Go to github cloud-application repository and create a new pull request for this change.  This <em>should<\/em> fail, since the provider doesn&#8217;t have this field.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"843\" height=\"603\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-25.png?resize=843%2C603&#038;ssl=1\" alt=\"\" class=\"wp-image-1431\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-25.png?w=843&amp;ssl=1 843w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-25.png?resize=300%2C215&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-25.png?resize=768%2C549&amp;ssl=1 768w\" sizes=\"auto, (max-width: 843px) 100vw, 843px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"326\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-26-1024x348.png?resize=960%2C326&#038;ssl=1\" alt=\"\" class=\"wp-image-1432\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-26.png?resize=1024%2C348&amp;ssl=1 1024w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-26.png?resize=300%2C102&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-26.png?resize=768%2C261&amp;ssl=1 768w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-26.png?w=1270&amp;ssl=1 1270w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Update the Provider to Fulfill the Contract<\/h2>\n\n\n\n<p>Switch back over to message-generator and add the code needed to fulfill the contract.<\/p>\n\n\n\n<p>Add <code>generatedDate <\/code>to <code>MessageResponseDTO <\/code>and <code>MessageModel <\/code>(I may have refactored the <code>MessageService <\/code>to return a <code>MessageModel <\/code>object that looks like this)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.bullyrooks.messagegenerator.service.model;\n\nimport lombok.AllArgsConstructor;\nimport lombok.Builder;\nimport lombok.Data;\nimport lombok.NoArgsConstructor;\n\nimport java.time.Instant;\n\n@Data\n@Builder\n@AllArgsConstructor\n@NoArgsConstructor\npublic class MessageModel {\n\n    private String message;\n    private Instant generatedDate;\n}\n<\/code><\/pre>\n\n\n\n<p>Update <code>MessageService <\/code>to return the <code>generatedDate<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    public MessageModel getMessage(){\n        MessageModel model = MessageModel.builder()\n                .message(faker.gameOfThrones().quote())\n                .generatedDate(Instant.now())\n                .build();\n\n        return model;\n    }<\/code><\/pre>\n\n\n\n<p>Update <code>MessageControllerContractIT <\/code>test so that it can fulfill the contract<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    @State(\"generator creates a message\")\n    public void shouldReturnMessage() {\n        \/\/@formatter:off\n        MessageModel dto = MessageModel.builder()\n                .message(\"All dwarfs are bastards in their father's eyes\")\n                .generatedDate(Instant.parse(\"2022-03-07T18:37:54.124523300Z\"))\n                .build();\n        Mockito.when(service.getMessage()).thenReturn(dto);\n        \/\/@formatter:on\n    }<\/code><\/pre>\n\n\n\n<p>and update <code>MessateControllerTest <\/code>to expect the <code>generatedDate <\/code>field<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        \/\/Verify request succeed\n        assertEquals(200, result.getStatusCodeValue());\n        MessageResponseDTO response = result.getBody();\n        log.info(\"Test message returned: {}\",response.getMessage());\n        assertTrue(StringUtils.isNotBlank(response.getMessage()));\n        assertNotNull(response.getGeneratedDate());<\/code><\/pre>\n\n\n\n<p>Go ahead and push your feature branch and create the pull request in <code>message-generator<\/code>.  This <em>should<\/em> pass so you can merge.  If it does, go ahead and do so<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"844\" height=\"814\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-27.png?resize=844%2C814&#038;ssl=1\" alt=\"\" class=\"wp-image-1433\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-27.png?w=844&amp;ssl=1 844w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-27.png?resize=300%2C289&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-27.png?resize=768%2C741&amp;ssl=1 768w\" sizes=\"auto, (max-width: 844px) 100vw, 844px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Rebuild the Consumer <\/h2>\n\n\n\n<p>Switch back over to your cloud-application pull request, click on the failed build and restart it as we did before (wait for the provider build to main to succeed first just in case, it <em>should <\/em>work without needing to wait though)<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"848\" height=\"293\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-28.png?resize=848%2C293&#038;ssl=1\" alt=\"\" class=\"wp-image-1434\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-28.png?w=848&amp;ssl=1 848w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-28.png?resize=300%2C104&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-28.png?resize=768%2C265&amp;ssl=1 768w\" sizes=\"auto, (max-width: 848px) 100vw, 848px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>This build should now succeed and you can view the successful build in the pull request as well as the contract fulfillment via pactflow<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"840\" height=\"657\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-29.png?resize=840%2C657&#038;ssl=1\" alt=\"\" class=\"wp-image-1436\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-29.png?w=840&amp;ssl=1 840w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-29.png?resize=300%2C235&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-29.png?resize=768%2C601&amp;ssl=1 768w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"279\" src=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-30.png?resize=960%2C279&#038;ssl=1\" alt=\"\" class=\"wp-image-1437\" srcset=\"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-30.png?w=1009&amp;ssl=1 1009w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-30.png?resize=300%2C87&amp;ssl=1 300w, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-30.png?resize=768%2C223&amp;ssl=1 768w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>Go ahead an merge the pull request now.<\/p>\n\n\n\n<p>That&#8217;s it!  We&#8217;re now successfully blocking breaking builds from the consumer application.  We can also make a breaking change on the provider side, but its essentially the same process (i.e. remove the generatedDate that we just added) and the change will not make it through the pull request or will it actually deploy if someone forces the change to main.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"entry-summary\">\nWe&#8217;re going to go back to cloud-application at this point and update&hellip;\n<\/div>\n<div class=\"link-more\"><a href=\"https:\/\/bullyrooks.com\/index.php\/2022\/03\/12\/kube-cloud-pt6-update-to-consumer-contract\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &ldquo;Kube Cloud Pt6 | Break the Contract from a Consumer Change&rdquo;<\/span>&hellip;<\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[199,147,197,198],"course":[196],"class_list":["post-1395","post","type-post","status-publish","format-standard","hentry","category-software-development","tag-contract-testing","tag-github-actions","tag-pact","tag-pactflow","course-kube-cloud-pt6-contract-testing","entry"],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":1356,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/02\/27\/kube-cloud-pt5-create-an-event-consumer\/","url_meta":{"origin":1395,"position":0},"title":"Kube Cloud Pt5 | Create an Event Consumer","author":"Bullyrook","date":"February 27, 2022","format":false,"excerpt":"Now that we've got messages being published to kafka, we are going to need to build our consumer that receives those events and stores them into the mongo database. Go ahead and create a new repository called message-repository according to the microservice startup course here. This is the pom.xml that\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-49.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-49.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-49.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1377,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/03\/08\/kube-cloud-pt6-consumer-contract-tests-for-rest-endpoints\/","url_meta":{"origin":1395,"position":1},"title":"Kube Cloud Pt6 | Consumer Contract Tests for REST Endpoints","author":"Bullyrook","date":"March 8, 2022","format":false,"excerpt":"Let's start with cloud-application, create a new branch git checkout -b client-contract Lets add the necessary dependencies to our pom.xml <pact.version>4.0.10<\/pact.version> <pact.provider.maven.plugin>4.3.5<\/pact.provider.maven.plugin> <\/properties> ... <!-- Contract Testing --> <dependency> <groupId>au.com.dius<\/groupId> <artifactId>pact-jvm-consumer-junit5<\/artifactId> <version>${pact.version}<\/version> <scope>test<\/scope> <\/dependency> ... <plugin> <groupId>au.com.dius.pact.provider<\/groupId> <artifactId>maven<\/artifactId> <version${pact.provider.maven.plugin}<\/version> <configuration> <pactBrokerUrl>${env.PACTFLOW_URL}<\/pactBrokerUrl> <pactBrokerToken>${env.PACTFLOW_TOKEN}<\/pactBrokerToken> <projectVersion>${env.PACT_PUBLISH_CONSUMER_VERSION}<\/projectVersion> <pactBrokerAuthenticationScheme>Bearer<\/pactBrokerAuthenticationScheme> <\/configuration> <\/plugin> Pact is mostly a\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/Screen-Shot-2022-03-02-at-2.04.53-PM.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/Screen-Shot-2022-03-02-at-2.04.53-PM.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/Screen-Shot-2022-03-02-at-2.04.53-PM.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/Screen-Shot-2022-03-02-at-2.04.53-PM.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/Screen-Shot-2022-03-02-at-2.04.53-PM.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":1258,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/02\/13\/kube-cloud-pt3-rest-interaction\/","url_meta":{"origin":1395,"position":2},"title":"Kube Cloud Pt3 | REST Interaction","author":"Bullyrook","date":"February 13, 2022","format":false,"excerpt":"Now that we've got a new service, we're going to make it discoverable via kubernetes and call it from the cloud application service. Enable Kubernetes Features Let's start a new branch in our cloud_application project $ git checkout -b kube Switched to a new branch 'kube' Edit the pom.xml and\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":1069,"url":"https:\/\/bullyrooks.com\/index.php\/2021\/07\/23\/spring-boot-lambda-implementation\/","url_meta":{"origin":1395,"position":3},"title":"Spring Boot Lambda Implementation","author":"Bullyrook","date":"July 23, 2021","format":false,"excerpt":"Now we're going to add some code. I'm going to follow my ports and adapters method of building a DTO and value object that I've used previously. Yes, its a bit of overkill for this project (especially a hello world example), but if you're using this course as a springboard\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2021\/07\/image-4.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1339,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/02\/27\/kube-cloud-pt5-create-an-event-publisher\/","url_meta":{"origin":1395,"position":4},"title":"Kube Cloud Pt5 | Create an Event Publisher","author":"Bullyrook","date":"February 27, 2022","format":false,"excerpt":"We're going to be updating cloud-application to remove the mongodb repository logic and replace it with an event publisher. Create a new branch from main git checkout -b migrate Update the pom.xml first, remove the mongodb dependencies <dependency> <groupId>org.springframework.boot<\/groupId> <artifactId>spring-boot-starter-data-mongodb<\/artifactId> <\/dependency> ... <dependency> <groupId>org.testcontainers<\/groupId> <artifactId>mongodb<\/artifactId> <version>1.16.3<\/version> <scope>test<\/scope> <\/dependency> and add\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-39.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-39.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/02\/image-39.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1387,"url":"https:\/\/bullyrooks.com\/index.php\/2022\/03\/08\/kube-cloud-pt6-provider-contract-test-for-rest-endpoints\/","url_meta":{"origin":1395,"position":5},"title":"Kube Cloud Pt6 | Provider Contract Test for REST Endpoints","author":"Bullyrook","date":"March 8, 2022","format":false,"excerpt":"Now lets move over to message-generator repo and create a new branch git checkout -b provider-test Pom Updates for Dependencies Update the pom.xml to pull in both the provider test library and the plugin ... <pact.version>4.3.5<\/pact.version> <maven-failsafe-plugin.version>3.0.0-M5<\/maven-failsafe-plugin.version> <maven-surefire-plugin.version>3.0.0-M5<\/maven-surefire-plugin.version> <pact.maven.plugin.version>4.3.5<\/pact.maven.plugin.version> <\/properties> ... <profiles> <profile> <id>contract<\/id> <build> <plugins> <plugin> <artifactId>maven-surefire-plugin<\/artifactId> <version>${maven-surefire-plugin.version}<\/version> <configuration>\u2026","rel":"","context":"In &quot;Software Development&quot;","block_context":{"text":"Software Development","link":"https:\/\/bullyrooks.com\/index.php\/category\/software-development\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/bullyrooks.com\/wp-content\/uploads\/2022\/03\/image-10.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/comments?post=1395"}],"version-history":[{"count":4,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1395\/revisions"}],"predecessor-version":[{"id":1438,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/posts\/1395\/revisions\/1438"}],"wp:attachment":[{"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/media?parent=1395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/categories?post=1395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/tags?post=1395"},{"taxonomy":"course","embeddable":true,"href":"https:\/\/bullyrooks.com\/index.php\/wp-json\/wp\/v2\/course?post=1395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}