
driven-adapter.r2dbc-postgresql.my-reactive-repository-adapter.unit.test.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scaffold-clean-architecture Show documentation
Show all versions of scaffold-clean-architecture Show documentation
Gradle plugin to create a clean application in Java that already works, It follows our best practices!
package {{package}}.r2dbc;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import org.reactivecommons.utils.ObjectMapper;
import org.springframework.data.domain.Example;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;
@ExtendWith(MockitoExtension.class)
class MyReactiveRepositoryAdapterTest {
// TODO: change four you own tests
@InjectMocks
MyReactiveRepositoryAdapter repositoryAdapter;
@Mock
MyReactiveRepository repository;
@Mock
ObjectMapper mapper;
@Test
void mustFindValueById() {
when(repository.findById("1")).thenReturn(Mono.just("test"));
when(mapper.map("test", Object.class)).thenReturn("test");
Mono
© 2015 - 2025 Weber Informatics LLC | Privacy Policy