From fb91356b7777dfa5b6088bcc3a48b43924c1c0fd Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Thu, 3 Sep 2026 14:35:10 +0200 Subject: build: apply Spotless plugin (#293) --- .../dnpm/oshelper/atc/AgentCodeServiceTest.java | 90 +++++++++++----------- 1 file changed, 43 insertions(+), 47 deletions(-) (limited to 'src/test/java/dev/dnpm/oshelper/atc/AgentCodeServiceTest.java') diff --git a/src/test/java/dev/dnpm/oshelper/atc/AgentCodeServiceTest.java b/src/test/java/dev/dnpm/oshelper/atc/AgentCodeServiceTest.java index 7516b08..95030b5 100644 --- a/src/test/java/dev/dnpm/oshelper/atc/AgentCodeServiceTest.java +++ b/src/test/java/dev/dnpm/oshelper/atc/AgentCodeServiceTest.java @@ -19,65 +19,61 @@ package dev.dnpm.oshelper.atc; -import dev.dnpm.oshelper.atc.services.AgentCodeService; -import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; +import dev.dnpm.oshelper.atc.services.AgentCodeService; import java.util.List; - -import static org.assertj.core.api.Assertions.assertThat; +import org.junit.jupiter.api.Test; class AgentCodeServiceTest { - @Test - void shouldReturnLatestAvailableAgentCodeVersion() { - var testAgentCodes = List.of( - new AtcCode("A01AD05", "Acetylsalicylsäure"), - new AtcCode("A01AD05", "Acetylsalicylsäure", "2025"), - new AtcCode("A01AD05", "Acetylsalicylsäure", "2026"), - new UnregisteredCode("A01AD05", "Acetylsalicylsäure"), - new UnregisteredCode("", "Acetylsalicylsäure") - ); - - var actual = AgentCodeService.latestAgentCodeVersions(testAgentCodes, AgentCodeService.byNameAndCode); + @Test + void shouldReturnLatestAvailableAgentCodeVersion() { + var testAgentCodes = + List.of( + new AtcCode("A01AD05", "Acetylsalicylsäure"), + new AtcCode("A01AD05", "Acetylsalicylsäure", "2025"), + new AtcCode("A01AD05", "Acetylsalicylsäure", "2026"), + new UnregisteredCode("A01AD05", "Acetylsalicylsäure"), + new UnregisteredCode("", "Acetylsalicylsäure")); - assertThat(actual).containsAll( - List.of( - new AtcCode("A01AD05", "Acetylsalicylsäure", "2026"), - new UnregisteredCode("", "Acetylsalicylsäure") - ) - ); - } + var actual = + AgentCodeService.latestAgentCodeVersions(testAgentCodes, AgentCodeService.byNameAndCode); - @Test - void shouldReturnLatestAvailableAgentCodeVersionByNameOnly() { - var testAgentCodes = List.of( - new AtcCode("A01AD05", "Acetylsalicylsäure"), - new AtcCode("A01AD05", "Acetylsalicylsäure", "2025"), + assertThat(actual) + .containsAll( + List.of( new AtcCode("A01AD05", "Acetylsalicylsäure", "2026"), - new UnregisteredCode("A01AD05", "Acetylsalicylsäure"), - new UnregisteredCode("", "Acetylsalicylsäure") - ); + new UnregisteredCode("", "Acetylsalicylsäure"))); + } - var actual = AgentCodeService.latestAgentCodeVersions(testAgentCodes, AgentCodeService.byCodeOnly); + @Test + void shouldReturnLatestAvailableAgentCodeVersionByNameOnly() { + var testAgentCodes = + List.of( + new AtcCode("A01AD05", "Acetylsalicylsäure"), + new AtcCode("A01AD05", "Acetylsalicylsäure", "2025"), + new AtcCode("A01AD05", "Acetylsalicylsäure", "2026"), + new UnregisteredCode("A01AD05", "Acetylsalicylsäure"), + new UnregisteredCode("", "Acetylsalicylsäure")); - assertThat(actual).containsExactly( - new AtcCode("A01AD05", "Acetylsalicylsäure", "2026") - ); - } + var actual = + AgentCodeService.latestAgentCodeVersions(testAgentCodes, AgentCodeService.byCodeOnly); - @Test - void shouldReturnLatestAvailableAgentCodeWithoutVersionVersionByNameOnly() { - var testAgentCodes = List.of( - new UnregisteredCode("A01AD05", "Acetylsalicylsäure"), - new AtcCode("A01AD05", "Acetylsalicylsäure"), - new UnregisteredCode("", "Acetylsalicylsäure") - ); + assertThat(actual).containsExactly(new AtcCode("A01AD05", "Acetylsalicylsäure", "2026")); + } - var actual = AgentCodeService.latestAgentCodeVersions(testAgentCodes, AgentCodeService.byCodeOnly); + @Test + void shouldReturnLatestAvailableAgentCodeWithoutVersionVersionByNameOnly() { + var testAgentCodes = + List.of( + new UnregisteredCode("A01AD05", "Acetylsalicylsäure"), + new AtcCode("A01AD05", "Acetylsalicylsäure"), + new UnregisteredCode("", "Acetylsalicylsäure")); - assertThat(actual).containsExactly( - new AtcCode("A01AD05", "Acetylsalicylsäure") - ); - } + var actual = + AgentCodeService.latestAgentCodeVersions(testAgentCodes, AgentCodeService.byCodeOnly); + assertThat(actual).containsExactly(new AtcCode("A01AD05", "Acetylsalicylsäure")); + } } -- cgit v1.2.3