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);
}
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);
}
Aggregations