|
|
@ -62,6 +62,7 @@ import org.thingsboard.server.common.data.notification.rule.NotificationRule; |
|
|
import org.thingsboard.server.common.data.notification.targets.NotificationTarget; |
|
|
import org.thingsboard.server.common.data.notification.targets.NotificationTarget; |
|
|
import org.thingsboard.server.common.data.notification.template.NotificationTemplate; |
|
|
import org.thingsboard.server.common.data.notification.template.NotificationTemplate; |
|
|
import org.thingsboard.server.common.data.oauth2.OAuth2Client; |
|
|
import org.thingsboard.server.common.data.oauth2.OAuth2Client; |
|
|
|
|
|
import org.thingsboard.server.common.data.pat.ApiKey; |
|
|
import org.thingsboard.server.common.data.queue.Queue; |
|
|
import org.thingsboard.server.common.data.queue.Queue; |
|
|
import org.thingsboard.server.common.data.queue.QueueStats; |
|
|
import org.thingsboard.server.common.data.queue.QueueStats; |
|
|
import org.thingsboard.server.common.data.rpc.Rpc; |
|
|
import org.thingsboard.server.common.data.rpc.Rpc; |
|
|
@ -169,6 +170,8 @@ public class TenantIdLoaderTest { |
|
|
private JobService jobService; |
|
|
private JobService jobService; |
|
|
@Mock |
|
|
@Mock |
|
|
private AiModelService aiModelService; |
|
|
private AiModelService aiModelService; |
|
|
|
|
|
@Mock |
|
|
|
|
|
private ApiKeyService apiKeyService; |
|
|
|
|
|
|
|
|
private TenantId tenantId; |
|
|
private TenantId tenantId; |
|
|
private TenantProfileId tenantProfileId; |
|
|
private TenantProfileId tenantProfileId; |
|
|
@ -203,7 +206,6 @@ public class TenantIdLoaderTest { |
|
|
case TENANT: |
|
|
case TENANT: |
|
|
case NOTIFICATION: |
|
|
case NOTIFICATION: |
|
|
case ADMIN_SETTINGS: |
|
|
case ADMIN_SETTINGS: |
|
|
case API_KEY: |
|
|
|
|
|
break; |
|
|
break; |
|
|
case CUSTOMER: |
|
|
case CUSTOMER: |
|
|
Customer customer = new Customer(); |
|
|
Customer customer = new Customer(); |
|
|
@ -400,6 +402,12 @@ public class TenantIdLoaderTest { |
|
|
when(ctx.getAiModelService()).thenReturn(aiModelService); |
|
|
when(ctx.getAiModelService()).thenReturn(aiModelService); |
|
|
doReturn(Optional.of(aiModel)).when(aiModelService).findAiModelById(eq(tenantId), any()); |
|
|
doReturn(Optional.of(aiModel)).when(aiModelService).findAiModelById(eq(tenantId), any()); |
|
|
break; |
|
|
break; |
|
|
|
|
|
case API_KEY: |
|
|
|
|
|
ApiKey apiKey = new ApiKey(); |
|
|
|
|
|
apiKey.setTenantId(tenantId); |
|
|
|
|
|
when(ctx.getApiKeyService()).thenReturn(apiKeyService); |
|
|
|
|
|
doReturn(apiKey).when(apiKeyService).findApiKeyById(eq(tenantId), any()); |
|
|
|
|
|
break; |
|
|
default: |
|
|
default: |
|
|
throw new RuntimeException("Unexpected originator EntityType " + entityType); |
|
|
throw new RuntimeException("Unexpected originator EntityType " + entityType); |
|
|
} |
|
|
} |
|
|
|