Format content with baeldung formatter

This commit is contained in:
mcasari 2023-08-22 19:49:54 +02:00
parent c6e1f95e42
commit 8a6e3f233e
5 changed files with 80 additions and 78 deletions

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <appender name="STDOUT"
class="ch.qos.logback.core.ConsoleAppender">
<encoder> <encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern> </pattern>

View File

@ -12,16 +12,17 @@ class ShallowDeepCopyUnitTest {
Main main = new Main(dependency); Main main = new Main(dependency);
Main shallowClone = (Main) main.clone(); Main shallowClone = (Main) main.clone();
dependency.setValue(17); dependency.setValue(17);
assertEquals(17, shallowClone.getDependency().getValue()); assertEquals(17, shallowClone.getDependency()
.getValue());
} }
@Test @Test
public void givenAnObjectAndADependency_whenDeepClonedAndDepencyChanges_ThenDepencyKeepsOldValue() throws Exception { public void givenAnObjectAndADependency_whenDeepClonedAndDepencyChanges_ThenDepencyKeepsOldValue() throws Exception {
Dependency dependency = new Dependency(13); Dependency dependency = new Dependency(13);
Main main = new Main(dependency); Main main = new Main(dependency);
Main deepClone = (Main) main.deepClone(); Main deepClone = (Main) main.deepClone();
dependency.setValue(17); dependency.setValue(17);
assertEquals(13, deepClone.getDependency().getValue()); assertEquals(13, deepClone.getDependency()
.getValue());
} }
} }