<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lucas Ribeiro on Medium]]></title>
        <description><![CDATA[Stories by Lucas Ribeiro on Medium]]></description>
        <link>https://medium.com/@lucasnunesr?source=rss-aefb2e6450f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EoDbY6dbIof65oMRkNZByw.jpeg</url>
            <title>Stories by Lucas Ribeiro on Medium</title>
            <link>https://medium.com/@lucasnunesr?source=rss-aefb2e6450f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 04:45:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lucasnunesr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Matter of Naming Tests Properly]]></title>
            <link>https://medium.com/@lucasnunesr/the-matter-of-naming-tests-properly-c14508dab302?source=rss-aefb2e6450f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c14508dab302</guid>
            <category><![CDATA[aem]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[junit]]></category>
            <dc:creator><![CDATA[Lucas Ribeiro]]></dc:creator>
            <pubDate>Thu, 27 Mar 2025 19:21:40 GMT</pubDate>
            <atom:updated>2025-03-27T19:21:40.057Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9P5iNP74mXsJ86mXppYWVg.png" /></figure><p>Hello! If you’re a developer like me, you know that one of the hardest things in our job is naming things. We’ve all been there — staring at the screen, trying to come up with a name, and scratching our heads with no clue what to do.</p><p>This struggle doesn’t disappear when we write tests. In fact, naming test methods can be just as tricky — especially when working with tools like <strong>JUnit</strong>.</p><p>Let’s be honest, we’ve probably all written something like this:</p><pre>@Test<br>void isSomethingHereThatIMightWantToTest() {<br>    // ...<br>}</pre><p>Technically, it works, but… what is this testing? What’s the behavior? What’s the expected result? It’s vague and hard to understand.</p><p>We write in English, sure — but let’s face it: for backend or full-stack developers, our main language is <strong>Java</strong> (or whatever language you use). And Java tends to be verbose — so why not embrace that and use it to our advantage?</p><p>That’s why I started using the when…then… pattern in my test method names. It brings more <strong>readability and intent</strong> to the code.</p><p>Let’s take an example. Suppose your application has features like user profile, registration, and login. Using the when...then naming pattern, your tests might look like this:</p><pre>@Test<br>void whenRequestUserProfileByID_andUserNotExist_thenResultReturnEmpty() {<br>    // ...<br>}<br><br>@Test<br>void whenUserSendRegister_andNameIsEmpty_thenShowMessageToFillEmptyField() {<br>    // ...<br>}<br><br>@Test<br>void whenUserLogin_andPasswordIsWrong_thenShowMessageWrongAccessCredential() {<br>    // ...<br>}</pre><p>Now, without even looking at the code inside, we already know:</p><ul><li>What the condition is</li><li>What’s being tested</li><li>What we expect to happen</li></ul><p>This naming style isn’t new. It’s been used and refined in many teams and frameworks over the years. It doesn’t require a fancy testing library — just a bit of <strong>structure and intention</strong>.</p><h3>Why not create your own version of it?</h3><p>Naming conventions like this make it easier for:</p><ul><li>New developers joining the project</li><li>Your future self trying to understand what you did 6 months ago</li><li>Reviewers reading your test during code reviews</li></ul><p>So here’s my advice:</p><blockquote><strong><em>Choose a pattern. Make it readable. Be intentional. And make your tests tell a story.</em></strong></blockquote><p>That way, your tests become more than just checks — they become <strong>living documentation</strong> of your system’s behavior.</p><h3>📚 Want to go deeper?</h3><p>You can start by reading <a href="https://martinfowler.com/bliki/GivenWhenThen.html">Martin Fowler’s article on Given–When–Then</a>, which lays the foundation for thinking about behavior in a structured and readable way.<br> Then check out <a href="https://dannorth.net/">Dan North’s work</a>, the creator of <strong>Behavior-Driven Development (BDD)</strong>, where he explains how naming and structure can connect technical clarity to business understanding.</p><p>The idea behind these approaches is simple:</p><blockquote><em>To make software easier to understand and maintain — both technically and formally — while aligning with business needs and bridging the gap between developers and domain experts.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c14508dab302" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AEM with Docker]]></title>
            <link>https://medium.com/@lucasnunesr/aem-with-docker-07b2404feeb2?source=rss-aefb2e6450f------2</link>
            <guid isPermaLink="false">https://medium.com/p/07b2404feeb2</guid>
            <category><![CDATA[aemasacloudservice]]></category>
            <category><![CDATA[aem-features]]></category>
            <category><![CDATA[aem-developer]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aem]]></category>
            <dc:creator><![CDATA[Lucas Ribeiro]]></dc:creator>
            <pubDate>Thu, 16 Nov 2023 04:38:13 GMT</pubDate>
            <atom:updated>2023-11-16T04:57:52.602Z</atom:updated>
            <content:encoded><![CDATA[<p>This article will guide you through a simple process to set up any author or publish instance in less than a minute. All you need to do is type a few commands and your new instance will be up and running. Today, we will prepare our <strong>AEM</strong> base instance image and use it to create our author and publish images. These simple steps will demonstrate how <strong>Docker</strong> can make our <strong>work easier.</strong></p><p><strong>what we will do:</strong></p><p>1 —<strong> Three docker images </strong>aem-base, aem-author, aem-publish.<br>2 — One<strong> local docker network to share data between containers</strong> and access to the internet.<br>3 — One container running with AEM as a cloud service on <strong>AUTHOR mode.</strong><br>4— One container running with AEM as a cloud service on<strong> PUBLISH mode.</strong></p><p><strong>requirements:</strong></p><p>1 - You need access to Adobe Software Distribution, to download AEM as a Cloud Service SDK.</p><p>2 - You need to have docker already installed on your OS.</p><p><strong>Let’s begin…</strong></p><p>If you have already downloaded the SDK rar file and installed Docker, you&#39;re all set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*hd9jtj8_OL7H0du_UkKdWA.png" /><figcaption>just unrar the file</figcaption></figure><p>Renaming the JAR to simplify tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/1*9PG1SaZohoR8F1wxPCs7ag.png" /></figure><p>I will create three text files without extensions. they are my DOCKERFILE.</p><p>base, author, and publish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*1Zq_Rko933u4ycoW_UbHhw.png" /><figcaption>just created a text file but I will remove the text extension</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*rhTEl86qDLzxN3meocwrVw.png" /></figure><p>I will remove the extensions of the author and publish text files, or alternatively, you can use the command &#39;touch base author publish&#39; in the Git Bash terminal, it will have the same effect and is easier to do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*oqVrurziTEqiX__qj0taew.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*oduh5I8773A4SLpEiNB_aA.png" /></figure><p>Now we will edit the three files without extensions using a text editor such as NOTEPAD or any editor you have there. you can use vscode as well.</p><p><strong>BASE FILE</strong></p><pre># Using &#39;ubuntu&#39; as the base image here<br>FROM ubuntu<br><br># setting the working directory<br>WORKDIR /opt/aem<br><br># Copy AEM as cloud service SDK<br>COPY instance.jar instance.jar<br><br># Install Java<br>RUN apt-get update &amp;&amp; \<br>    apt-get install -y curl &amp;&amp; \<br>    apt-get install -y software-properties-common &amp;&amp; \<br>    add-apt-repository ppa:openjdk-r/ppa &amp;&amp; \<br>    apt-get update &amp;&amp; \<br>    apt-get install -y openjdk-11-jdk<br><br># Unack the Jar file<br>RUN java -jar instance.jar -unpack</pre><p><strong>AUTHOR FILE</strong></p><pre># Use the previously created aem-base<br>FROM aem-base<br><br># Expose AEM author in port 4502<br>EXPOSE 4502<br><br># Make the container start always in Author mode with Port 4502<br>ENTRYPOINT [&quot;java&quot;, &quot;-jar&quot;, &quot;instance.jar&quot;, &quot;-r&quot;, &quot;author&quot;, &quot;-p&quot;, &quot;4502&quot;, &quot;-verbose&quot;]</pre><p><strong>PUBLISH FILE</strong></p><pre># Use the previously created aem-base<br>FROM aem-base<br><br># Expose AEM publish in port 4503<br>EXPOSE 4503<br><br># Make the container start always in Publish mode with Port 4503<br>ENTRYPOINT [&quot;java&quot;, &quot;-jar&quot;, &quot;instance.jar&quot;, &quot;-r&quot;, &quot;publish&quot;, &quot;-p&quot;, &quot;4503&quot;, &quot;-verbose&quot;]</pre><p>Now that you&#39;ve created and edited the files, I&#39;ll use my terminal to create the Docker images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8bJ4Q6WMkiOxRevU78l-cg.png" /><figcaption><strong>I am using PowerShell and WSL with Docker. However, if you have Docker Desktop, it is easier.</strong></figcaption></figure><blockquote>I will type <strong>docker build -f base -t aem-base</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DQhThCnXqEnJ3lz9CFKSHA.png" /></figure><p>wait for the build to finish…</p><blockquote>now I will type <strong>docker build -f author -t aem-author</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rD8YWO1C7pLoqWn9g13n8g.png" /></figure><p>again wait for the build to finish…</p><blockquote>now I will type <strong>docker build -f publish -t aem-publish</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2T2VClfL_JRq5s3LJ5ZxWw.png" /></figure><p>We have created the three base images to easily create the author and publish instances.</p><p>When I typed &quot;<strong>docker image ls</strong>&quot;, three images appeared on the list: aem-author, aem-publish, and aem-base.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AwsONp_mbaV6yUJJhE87jg.png" /></figure><p>Before we create your containers, <strong>we need to grant internet access to the containers and enable data sharing between them.</strong> Let&#39;s create a <strong>local network</strong> called <strong>adobe</strong>.</p><blockquote>on the terminal type <strong>docker network create adobe</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tx2WHsntQKHTCgnhChqg2Q.png" /></figure><p>We are now prepared to proceed and establish our containers. Let&#39;s get started.</p><p>First let’s create the author instance.</p><pre>docker run -d --name author -p 4502:4502 --network adobe aem-author</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dfIRuPO-G4gP0T7jwEUMHw.png" /></figure><p>We should hold on for the author instance to become available. You can check by using the command &quot;<strong>docker logs -f author</strong>&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2Ak_2qfKHBr_ktaNZCkFw.png" /></figure><p>Please wait for approximately five minutes. Previously, I said it would take less than a minute. However, after the first time, the container will start up more quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cka9TSZ_nGH7Qo-AnsfSwg.png" /></figure><p>Once you see “Quickstart started on terminal”, you&#39;re all set to proceed. Let&#39;s check the browser.</p><p>Open your preferred browser and type <a href="http://localhost:4502/"><strong>http://localhost:4502</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*71sU6Dg8hmiFlCgIs1mYtQ.png" /></figure><p>The author instance is now operational. We need to proceed with setting up the publish instance.</p><p><strong>if you just need the author instance you can stop here…</strong></p><p>Let&#39;s create an instance of the<strong> publish </strong>using the same command used to create the author instance but with a few differences.</p><pre>docker run -d --name publish -p 4503:4503 --network adobe aem-publish</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4FXEX2nR8eGjalEXDArzjw.png" /></figure><p>let’s wait again for the instance to be ready just watching the logs from the docker container.</p><blockquote><strong>docker logs -f publish</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P_HWgbxd2ZdKLiqe2ciCWg.png" /></figure><p>you are ready to go when see the “<strong>Quickstart started message on terminal</strong>”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aic1ggmM-cIR34hVs0dVXQ.png" /></figure><p>let&#39;s check on the browser. <strong>http://localhost:4503</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8dnayKeAC8bIH_CEYz73uQ.png" /></figure><p><strong>there is nothing to see, we don’t have any project installed…<br></strong>but the publish container is operational now.</p><p><strong>next steps… I will update it with links…</strong><br>5 — Install a project on the author instance.<br>6 — Set up the publish agent on author instance.<br>7 — Set up the Apache dispatcher from AEM SDK.</p><p><strong>Hope you enjoyed the post and let me know if you need any help with the steps.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07b2404feeb2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>