<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>How-to on Garland — Java Integration Testing Framework</title>
    <link>https://garlandframework.dev/docs/how-to/</link>
    <description>Recent content in How-to on Garland — Java Integration Testing Framework</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>© 2026 Garland Framework</copyright>
    <lastBuildDate>Wed, 10 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://garlandframework.dev/docs/how-to/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>How to create test DTOs</title>
      <link>https://garlandframework.dev/docs/how-to/test-dtos/</link>
      <pubDate>Wed, 10 Jun 2026 00:00:00 +0000</pubDate>
      
      <guid>https://garlandframework.dev/docs/how-to/test-dtos/</guid>
      <description>&lt;p&gt;Before writing pipeline tests you need test DTOs — classes that mirror your production types but are shaped for test use. This page explains what to create and why.&lt;/p&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;Step 1 — Locate the production DTO&#xA;    &lt;div id=&#34;step-1--locate-the-production-dto&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#step-1--locate-the-production-dto&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Start in the service source. Find the DTO your endpoint accepts and returns:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight-wrapper&#34;&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;// user-service/src/main/java/.../dto/UserDto.java&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;public&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;record&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;UserDto&lt;/span&gt;(&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        UUID uuid,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        String name,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        String surname,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        AddressDto address,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        List&lt;span style=&#34;color:#f92672&#34;&gt;&amp;lt;&lt;/span&gt;CarDto&lt;span style=&#34;color:#f92672&#34;&gt;&amp;gt;&lt;/span&gt; cars,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        LocalDateTime createdAt,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        LocalDateTime modifiedAt&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;) {}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;p&gt;Note the field types — you will recreate this as a test DTO with the same fields but a different class form.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>How to test HTTP endpoints with Garland</title>
      <link>https://garlandframework.dev/docs/how-to/test-http/</link>
      <pubDate>Wed, 10 Jun 2026 00:00:00 +0000</pubDate>
      
      <guid>https://garlandframework.dev/docs/how-to/test-http/</guid>
      <description>&lt;p&gt;This page covers how to test HTTP endpoints with &lt;code&gt;HttpTestClient&lt;/code&gt; — from a basic status assertion to auth failures and validation error checking. All examples are taken from &lt;a href=&#34;https://github.com/garlandframework/garland-demo&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;garland-demo&lt;/a&gt; and run against the real stack — clone it to see them execute.&lt;/p&gt;&#xA;&lt;p&gt;These examples assume test DTOs are already in place. If you are starting from scratch, read &lt;a href=&#34;https://garlandframework.dev/docs/how-to/test-dtos/&#34; &gt;How to create test DTOs&lt;/a&gt; first.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;Assert status and deserialize the response&#xA;    &lt;div id=&#34;assert-status-and-deserialize-the-response&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#assert-status-and-deserialize-the-response&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The most common pattern. &lt;code&gt;makeCall&lt;/code&gt; asserts the status code and deserializes the response body in one step:&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>How to test HTTP → PostgreSQL with Garland</title>
      <link>https://garlandframework.dev/docs/how-to/test-http-to-db/</link>
      <pubDate>Wed, 10 Jun 2026 00:00:00 +0000</pubDate>
      
      <guid>https://garlandframework.dev/docs/how-to/test-http-to-db/</guid>
      <description>&lt;p&gt;This page walks through the full setup for asserting that an HTTP call persisted the correct data in PostgreSQL — from reading production classes through to a working pipeline test. All examples are taken from &lt;a href=&#34;https://github.com/garlandframework/garland-demo&#34;  target=&#34;_blank&#34; rel=&#34;noreferrer&#34;&gt;garland-demo&lt;/a&gt;; clone it to run them.&lt;/p&gt;&#xA;&lt;p&gt;This guide assumes test DTOs are already set up. If not, read &lt;a href=&#34;https://garlandframework.dev/docs/how-to/test-dtos/&#34; &gt;How to create test DTOs&lt;/a&gt; first.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2 class=&#34;relative group&#34;&gt;Step 1 — Locate the entity&#xA;    &lt;div id=&#34;step-1--locate-the-entity&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;&#xA;    &#xA;    &lt;span&#xA;        class=&#34;absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none&#34;&gt;&#xA;        &lt;a class=&#34;text-primary-300 dark:text-neutral-700 !no-underline&#34; href=&#34;#step-1--locate-the-entity&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;&#xA;    &lt;/span&gt;&#xA;    &#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Find the JPA entity that maps to the table your service writes to:&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>
