JAVA-13721 Fixing the formatting

This commit is contained in:
Dhawal Kapil 2023-05-16 22:56:17 +05:30
parent e5985b3739
commit 7b8fad5dc9
32 changed files with 738 additions and 739 deletions

View File

@ -29,14 +29,12 @@
<artifactId>spring-context</artifactId>
<version>${spring-framework.version}</version>
</dependency>
<!-- utils -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<!-- test scoped -->
<dependency>
<groupId>org.mockito</groupId>

View File

@ -1,6 +1,5 @@
package com.baeldung.mockito.argumentcaptor;
public enum Format {
TEXT_ONLY,
HTML
TEXT_ONLY, HTML
}

View File

@ -7,7 +7,7 @@ import com.baeldung.mockito.argumentmatchers.Message;
@Service
public class MessageService {
public Message deliverMessage (Message message) {
public Message deliverMessage(Message message) {
return message;
}

View File

@ -15,7 +15,6 @@ public class MessageMatcher implements ArgumentMatcher<Message> {
return left.getFrom().equals(right.getFrom()) &&
left.getTo().equals(right.getTo()) &&
left.getText().equals(right.getText()) &&
right.getDate() != null &&
right.getId() != null;
right.getDate() != null && right.getId() != null;
}
}

View File

@ -24,7 +24,8 @@ class MockitoExceptionUnitTest {
@Test
void givenVoidReturnType_whenUsingDoThrow_thenExceptionIsThrown() {
MyDictionary dictMock = mock(MyDictionary.class);
doThrow(IllegalStateException.class).when(dictMock).add(anyString(), anyString());
doThrow(IllegalStateException.class).when(dictMock)
.add(anyString(), anyString());
assertThrows(IllegalStateException.class, () -> dictMock.add("word", "meaning"));
}

View File

@ -80,7 +80,7 @@ class UserServiceUnitTest {
verify(mailClient).sendUserRegistrationMail(insertedUser);
}
//additional tests
// additional tests
@Test
void givenShortName_whenSaveUser_thenGiveShortUsernameError() {

View File

@ -71,7 +71,8 @@ class MockitoVoidMethodsUnitTest {
assertEquals(3, arg0);
assertEquals("answer me", arg1);
return null;
}).when(myList).add(any(Integer.class), any(String.class));
}).when(myList)
.add(any(Integer.class), any(String.class));
myList.add(3, "answer me");
}
@ -80,7 +81,8 @@ class MockitoVoidMethodsUnitTest {
void givenDoCallRealMethod_whenAddCalled_thenRealMethodCalled() {
MyList myList = mock(MyList.class);
doCallRealMethod().when(myList).add(any(Integer.class), any(String.class));
doCallRealMethod().when(myList)
.add(any(Integer.class), any(String.class));
myList.add(1, "real");
verify(myList, times(1)).add(1, "real");