use of com.icthh.xm.ms.entity.config.XmEntityTenantConfigService in project xm-ms-entity by xm-online.
the class FunctionServiceImplUnitTest method setUp.
@Before
public void setUp() {
xmEntitySpecService = Mockito.mock(XmEntitySpecService.class);
xmEntityService = Mockito.mock(XmEntityService.class);
functionExecutorService = Mockito.mock(FunctionExecutorService.class);
functionContextService = Mockito.mock(FunctionContextService.class);
dynamicPermissionCheckService = Mockito.mock(DynamicPermissionCheckService.class);
xmEntityTenantConfigService = Mockito.mock(XmEntityTenantConfigService.class);
jsonValidationService = spy(new JsonValidationService(new ObjectMapper()));
functionService = new FunctionServiceImpl(xmEntitySpecService, xmEntityService, functionExecutorService, functionContextService, dynamicPermissionCheckService, jsonValidationService, xmEntityTenantConfigService);
xmEntityTenantConfig = new XmEntityTenantConfig();
when(xmEntityTenantConfigService.getXmEntityTenantConfig()).thenReturn(xmEntityTenantConfig);
}
use of com.icthh.xm.ms.entity.config.XmEntityTenantConfigService in project xm-ms-entity by xm-online.
the class MailServiceUnitTest method before.
@Before
public void before() {
tenantConfigService = new XmEntityTenantConfigService(new XmConfigProperties(), tenantContextHolder);
MockitoAnnotations.initMocks(this);
when(tenantContextHolder.getTenantKey()).thenReturn("XM");
when(tenantContextHolder.getPrivilegedContext()).thenReturn(mock(PrivilegedTenantContext.class));
TenantContext mock = mock(TenantContext.class);
when(mock.getTenantKey()).thenReturn(java.util.Optional.of(TenantKey.valueOf("XM")));
when(tenantContextHolder.getContext()).thenReturn(mock);
}
Aggregations