Search in sources :

Example 1 with AttachmentService

use of com.icthh.xm.ms.entity.service.AttachmentService in project xm-ms-entity by xm-online.

the class AttachmentResourceIntTest method setup.

@Before
public void setup() throws URISyntaxException {
    lepManager.beginThreadContext(ctx -> {
        ctx.setValue(THREAD_CONTEXT_KEY_TENANT_CONTEXT, tenantContextHolder.getContext());
        ctx.setValue(THREAD_CONTEXT_KEY_AUTH_CONTEXT, authContextHolder.getContext());
    });
    MockitoAnnotations.initMocks(this);
    when(startUpdateDateGenerationStrategy.generateStartDate()).thenReturn(DEFAULT_START_DATE);
    attachmentService = new AttachmentService(attachmentRepository, attachmentSearchRepository, permittedRepository, permittedSearchRepository, startUpdateDateGenerationStrategy);
    AttachmentResource attachmentResourceMock = new AttachmentResource(attachmentService, attachmentResource);
    this.restAttachmentMockMvc = MockMvcBuilders.standaloneSetup(attachmentResourceMock).setCustomArgumentResolvers(pageableArgumentResolver).setControllerAdvice(exceptionTranslator).setValidator(validator).setMessageConverters(jacksonMessageConverter).build();
    attachment = createEntity(em);
}
Also used : AttachmentService(com.icthh.xm.ms.entity.service.AttachmentService) Before(org.junit.Before)

Example 2 with AttachmentService

use of com.icthh.xm.ms.entity.service.AttachmentService in project xm-ms-entity by xm-online.

the class AttachmentResourceExtendedIntTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    when(startUpdateDateGenerationStrategy.generateStartDate()).thenReturn(MOCKED_START_DATE);
    attachmentService = new AttachmentService(attachmentRepository, attachmentSearchRepository, permittedRepository, permittedSearchRepository, startUpdateDateGenerationStrategy);
    AttachmentResource attachmentResourceMock = new AttachmentResource(attachmentService, attachmentResource);
    this.restAttachmentMockMvc = MockMvcBuilders.standaloneSetup(attachmentResourceMock).setCustomArgumentResolvers(pageableArgumentResolver).setControllerAdvice(exceptionTranslator).setValidator(validator).setMessageConverters(jacksonMessageConverter).build();
    attachment = AttachmentResourceIntTest.createEntity(em);
}
Also used : AttachmentService(com.icthh.xm.ms.entity.service.AttachmentService) Before(org.junit.Before)

Aggregations

AttachmentService (com.icthh.xm.ms.entity.service.AttachmentService)2 Before (org.junit.Before)2