Search in sources :

Example 1 with LinkService

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

the class LinkResourceIntTest method setup.

@Before
public void setup() {
    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);
    linkService = new LinkService(linkRepository, linkSearchRepository, permittedRepository, permittedSearchRepository, startUpdateDateGenerationStrategy);
    LinkResource linkResourceMock = new LinkResource(linkService, linkResource);
    this.restLinkMockMvc = MockMvcBuilders.standaloneSetup(linkResourceMock).setCustomArgumentResolvers(pageableArgumentResolver).setControllerAdvice(exceptionTranslator).setMessageConverters(jacksonMessageConverter).build();
    link = createEntity(em);
}
Also used : LinkService(com.icthh.xm.ms.entity.service.LinkService) Before(org.junit.Before)

Example 2 with LinkService

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

the class LinkResourceExtendedIntTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    when(startUpdateDateGenerationStrategy.generateStartDate()).thenReturn(MOCKED_START_DATE);
    linkService = new LinkService(linkRepository, linkSearchRepository, permittedRepository, permittedSearchRepository, startUpdateDateGenerationStrategy);
    LinkResource linkResourceMock = new LinkResource(linkService, linkResource);
    this.restLinkMockMvc = MockMvcBuilders.standaloneSetup(linkResourceMock).setCustomArgumentResolvers(pageableArgumentResolver).setControllerAdvice(exceptionTranslator).setValidator(validator).setMessageConverters(jacksonMessageConverter).build();
    link = LinkResourceIntTest.createEntity(em);
}
Also used : LinkService(com.icthh.xm.ms.entity.service.LinkService) Before(org.junit.Before)

Aggregations

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