JAVA-13721 Fixing the formatting
This commit is contained in:
parent
e5985b3739
commit
7b8fad5dc9
|
@ -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>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.baeldung.mockito.argumentcaptor;
|
||||
|
||||
public enum Format {
|
||||
TEXT_ONLY,
|
||||
HTML
|
||||
TEXT_ONLY, HTML
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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"));
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ class UserServiceUnitTest {
|
|||
verify(mailClient).sendUserRegistrationMail(insertedUser);
|
||||
}
|
||||
|
||||
//additional tests
|
||||
// additional tests
|
||||
|
||||
@Test
|
||||
void givenShortName_whenSaveUser_thenGiveShortUsernameError() {
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue