Spaces:
Build error
Build error
| package com.dalab.discovery.sd.config; | |
| import java.util.Collections; | |
| import java.util.Map; | |
| import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | |
| import org.springframework.boot.test.context.TestConfiguration; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Primary; | |
| import com.dalab.discovery.common.config.cloud.impl.aws.AWSConfigService; | |
| import com.dalab.discovery.common.config.cloud.impl.azure.AzureConfigService; | |
| import com.dalab.discovery.common.config.cloud.impl.oracle.OracleConfigService; | |
| import com.dalab.discovery.common.model.ResourceType; | |
| /** | |
| * Test configuration that provides mock implementations for various services. | |
| */ | |
| public class TestConfig { | |
| /** | |
| * Provides a mock AWSConfigService for tests if none is present. | |
| */ | |
| public AWSConfigService mockAwsConfigService() { | |
| return new AWSConfigService() { | |
| public String getAccessKey() { | |
| return "test-access-key"; | |
| } | |
| public String getSecretKey() { | |
| return "test-secret-key"; | |
| } | |
| public String getRegion() { | |
| return "us-west-2"; | |
| } | |
| public boolean isSsmEnabled() { | |
| return false; | |
| } | |
| public String getSsmPrefix() { | |
| return "/test-prefix/"; | |
| } | |
| public String getS3BucketName() { | |
| return "test-bucket"; | |
| } | |
| public String getDynamoDBTableName() { | |
| return "test-table"; | |
| } | |
| public Map<String, String> getTags(ResourceType resourceType) { | |
| return Collections.emptyMap(); | |
| } | |
| public String getAccountId() { | |
| return "test-account-id"; | |
| } | |
| }; | |
| } | |
| /** | |
| * Provides a mock AzureConfigService for tests if none is present. | |
| */ | |
| public AzureConfigService mockAzureConfigService() { | |
| return new AzureConfigService() { | |
| public String getClientId() { | |
| return "test-client-id"; | |
| } | |
| public String getClientSecret() { | |
| return "test-client-secret"; | |
| } | |
| public String getTenantId() { | |
| return "test-tenant-id"; | |
| } | |
| // If AzureConfigService has other abstract methods, implement them here | |
| }; | |
| } | |
| /** | |
| * Provides a mock OracleConfigService for tests if none is present. | |
| */ | |
| public OracleConfigService mockOracleConfigService() { | |
| return new OracleConfigService() { | |
| public String getConfigFilePath() { | |
| return "classpath:config/test-oci-config"; | |
| } | |
| public String getProfileName() { | |
| return "DEFAULT"; | |
| } | |
| public String getTenancyId() { | |
| return "test-tenancy-id"; | |
| } | |
| public String getRegion() { | |
| return "us-phoenix-1"; | |
| } | |
| public String getDefaultCompartment() { | |
| return "test-compartment"; | |
| } | |
| public String getCompartmentId() { | |
| return "test-compartment-id"; | |
| } | |
| // If OracleConfigService has other abstract methods, implement them here | |
| }; | |
| } | |
| } |