Skip to content
Snippets Groups Projects
Commit 090316fb authored by Krzysztof Witukiewicz's avatar Krzysztof Witukiewicz
Browse files

OZG-7262 OZG-7584 Simplify tests

parent ef9612eb
No related branches found
No related tags found
1 merge request!6Ozg 7262 attarchments not null
......@@ -27,7 +27,6 @@ import static org.assertj.core.api.Assertions.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.*;
import java.util.Collection;
import java.util.Map;
import org.junit.jupiter.api.BeforeEach;
......@@ -165,21 +164,16 @@ class KommentarMapperTest {
void shouldCallAttachmentMapper() {
callMapper();
verify(attachmentMapper).mapAttachments(argThat(this::isCollectionOfAttachmentIds));
verify(attachmentMapper).mapAttachments(GrpcKommentarTestFactory.ATTACHMENTS);
}
@Test
void shouldMapAllFields() {
var kommentar = mapper.mapItemMapToKommentar(GrpcKommentarTestFactory.createItemAsMap());
var kommentar = callMapper();
assertThat(kommentar).usingRecursiveComparison().isEqualTo(KommentarTestFactory.create());
}
@SuppressWarnings("unchecked")
private boolean isCollectionOfAttachmentIds(Object obj) {
return obj instanceof Collection && ((Collection<String>) obj).containsAll(GrpcKommentarTestFactory.ATTACHMENTS);
}
private Kommentar callMapper() {
return mapper.mapItemMapToKommentar(GrpcKommentarTestFactory.createItemAsMap());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment