@@ -0,0 +1,3029 @@
+package io.oasp.logistic.ridesharing.requestmanagement.logic.impl;%0A%0Aimport io.oasp.logistic.ridesharing.requestmanagement.dataaccess.api.RequestEntity;%0Aimport io.oasp.logistic.ridesharing.requestmanagement.dataaccess.api.dao.RequestDao;%0Aimport io.oasp.logistic.ridesharing.requestmanagement.logic.api.to.RequestEto;%0Aimport io.oasp.module.beanmapping.common.api.BeanMapper;%0Aimport io.oasp.module.test.common.base.ModuleTest;%0A%0Aimport static org.mockito.Mockito.when;%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.junit.MockitoJUnit;%0Aimport org.mockito.junit.MockitoRule;%0A%0Apublic class RequestmanagementImplTest extends ModuleTest %7B%0A    /**%0A     * Initializes mocks before each test method.%0A     */%0A    @Rule%0A    public MockitoRule rule = MockitoJUnit.rule();%0A%0A    @Mock%0A    private BeanMapper beanMapper;%0A%0A    @Mock%0A    private RequestEntity requestEntity;%0A%0A    @Mock%0A    private RequestEto requestEto;%0A%0A    @Mock%0A    private RequestDao requestDao;%0A%0A    @InjectMocks%0A    RequestmanagementImpl requestmanagementImpl = new RequestmanagementImpl();%0A%0A    /**%0A     * This test method tests the %7B@code findRequest%7D method of %7B@link RequestmanagementImpl%7D by mocking needed%0A     * dependencies.%0A     */%0A    @Test%0A    public void testFindRequest() %7B%0A%0A        // given%0A        long id = 1L;%0A        Class%3CRequestEto%3E targetClass = RequestEto.class;%0A%0A        when(this.requestDao.find(id)).thenReturn(this.requestEntity);%0A        when(this.beanMapper.map(this.requestEntity, targetClass)).thenReturn(this.requestEto);%0A%0A        // when%0A        RequestEto resultEto = this.requestmanagementImpl.findRequest(id);%0A%0A        // then%0A        assertThat(resultEto).isNotNull();%0A        assertThat(resultEto).isEqualTo(this.requestEto);%0A    %7D%0A%0A    /**%0A     * This test method updates a saved requestEntity. It demonstrates the approach when there is a method call in the%0A     * method under test. To solve this in the given case you need to override the %7B@code @Inject%7D of the tested method by%0A     * using the appropriate setter %7B@code setRequestDao()%7D.%0A     */%0A    @Test%0A    public void testSaveRequest() %7B%0A%0A        // given%0A        long id = 1L;%0A%0A        when(this.requestEto.getId()).thenReturn(id);%0A        when(this.requestDao.find(id)).thenReturn(this.requestEntity);%0A//        when(this.requestEto.getName()).thenReturn(%22new Name%22);%0A//        when(this.requestEntity.getName()).thenReturn(%22old Name%22);%0A        when(this.beanMapper.map(this.requestEto, RequestEntity.class)).thenReturn(this.requestEntity);%0A        when(this.requestDao.save(this.requestEntity)).thenReturn(this.requestEntity);%0A        when(this.beanMapper.map(this.requestEntity, RequestEto.class)).thenReturn(this.requestEto);%0A%0A        // when%0A        this.requestmanagementImpl.setRequestDao(this.requestDao);%0A        RequestEto resultEto = this.requestmanagementImpl.saveRequest(this.requestEto);%0A%0A        // then%0A        assertThat(resultEto.getId()).isEqualTo(this.requestEto.getId());%0A    %7D%0A%7D%0A

add logic layer test