use of com.icthh.xm.commons.tenant.TenantContextHolder in project xm-ms-entity by xm-online.
the class XmTenantLifecycleServiceUnitTest method before.
@Before
public void before() {
MockitoAnnotations.initMocks(this);
TenantContextHolder tenantContextHolder = mock(TenantContextHolder.class);
when(tenantContextHolder.getContext()).thenReturn(tenantContext);
when(tenantContext.getTenant()).thenReturn(Optional.of(tenant));
when(tenant.isSuper()).thenReturn(true);
xmTenantLifecycleService = new XmTenantLifecycleService(tenantClients, applicationProperties, tenantContextHolder);
}
use of com.icthh.xm.commons.tenant.TenantContextHolder in project xm-ms-entity by xm-online.
the class XmEntitySpecServiceUnitTest method init.
@Before
@SneakyThrows
public void init() {
TenantContext tenantContext = mock(TenantContext.class);
when(tenantContext.getTenantKey()).thenReturn(Optional.of(TenantKey.valueOf(TENANT)));
tenantContextHolder = mock(TenantContextHolder.class);
when(tenantContextHolder.getContext()).thenReturn(tenantContext);
ApplicationProperties ap = new ApplicationProperties();
ap.setSpecificationPathPattern(URL);
xmEntitySpecService = createXmEntitySpecService(ap, tenantContextHolder);
}
Aggregations