Skip to content
Snippets Groups Projects
Commit ec48d935 authored by Alan Braz's avatar Alan Braz
Browse files

Merge branch 'ibm' of...

Merge branch 'ibm' of ssh.dev.azure.com:v3/slb-des-ext-collaboration/open-data-ecosystem/os-indexer into ibm
parents bf1ff6bb e7ef62b4
No related branches found
No related tags found
1 merge request!6Trusted ibm
......@@ -31,16 +31,16 @@ import com.cloudant.client.api.Database;
public class ElasticSettingSchemaRepositoryImpl implements ISchemaRepository {
private static final Logger logger = LoggerFactory.getLogger(ElasticSettingSchemaRepositoryImpl.class);
@Value("${ibm.cloudant.url}")
@Value("${ibm.cloudant.url}")
private String url;
@Value("${ibm.cloudant.apikey}")
private String apiKey;
@Value("${ibm.cloudant.dbname.prefix:local-dev}")
private String dbNamePrefix;
private Database db;
@PostConstruct
public void init(){
try {
......@@ -50,15 +50,15 @@ public class ElasticSettingSchemaRepositoryImpl implements ISchemaRepository {
e.printStackTrace();
}
}
@Override
@Override
public void add(ElasticSettingSchema schema, String id) {
ElasticSettingsDoc sd = new ElasticSettingsDoc();
sd.setId(id);
sd.setSettingSchema(schema);
db.save(sd);
}
@Override
public ElasticSettingSchema get(String id) {
if (db.contains(id)) {
......@@ -72,7 +72,7 @@ public class ElasticSettingSchemaRepositoryImpl implements ISchemaRepository {
} else {
logger.error(ElasticSettingsDoc.class + " with id " + id + " was not found in the database.");
return null;
}
}
}
}
......@@ -44,7 +44,6 @@ import org.opengroup.osdu.core.common.model.search.ClusterSettings;
import org.opengroup.osdu.core.common.provider.interfaces.IRequestInfo;
import org.opengroup.osdu.core.common.search.ElasticIndexNameResolver;
import org.opengroup.osdu.core.common.search.IndicesService;
import org.opengroup.osdu.indexer.ibm.util.IHeadersInfo;
import org.opengroup.osdu.indexer.logging.AuditLogger;
import org.opengroup.osdu.indexer.service.IndexCopyServiceImpl;
import org.opengroup.osdu.indexer.service.IndexerMappingService;
......@@ -66,8 +65,8 @@ public class IndexCopyServiceImplTest {
private HttpEntity httpEntityRequest;
@Mock
private IRequestInfo requestInfo;
@Mock
private IHeadersInfo headersInfo;
//@Mock TODO
//private IHeadersInfo headersInfo;
@Mock
private RestClient restClient;
@Mock
......@@ -105,7 +104,7 @@ public class IndexCopyServiceImplTest {
httpHeaders.put(DpsHeaders.AUTHORIZATION, "testAuth");
httpHeaders.put(DpsHeaders.CORRELATION_ID, correlationId);
DpsHeaders standardHeaders = DpsHeaders.createFromMap(httpHeaders);
when(headersInfo.getHeaders()).thenReturn(standardHeaders);
//when(headersInfo.getHeaders()).thenReturn(standardHeaders);
when(requestInfo.getHeadersMapWithDwdAuthZ()).thenReturn(httpHeaders);
when(response.getEntity()).thenReturn(httpEntity);
......
......@@ -26,7 +26,6 @@ import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.model.tenant.TenantInfo;
import org.opengroup.osdu.core.common.provider.interfaces.ITenantFactory;
import org.opengroup.osdu.indexer.ibm.util.IHeadersInfo;
import org.springframework.http.HttpHeaders;
import org.springframework.test.context.junit4.SpringRunner;
......@@ -38,8 +37,8 @@ public class TenantInfoServiceTest {
@Mock
private ITenantFactory tenantFactory;
@Mock
private IHeadersInfo headersInfo;
//@Mock
//private IHeadersInfo headersInfo;
// TODO alanbraz investigate
//@InjectMocks
//private TenantInfoService sut;
......@@ -65,9 +64,9 @@ public class TenantInfoServiceTest {
when(this.info.getName()).thenReturn("tenant1");
when(tenantFactory.getTenantInfo("tenant1")).thenReturn(info);
when(this.headersInfo.getHeaders()).thenReturn(HEADERS);
//when(this.headersInfo.getHeaders()).thenReturn(HEADERS);
when(this.headersInfo.getPartitionId()).thenReturn("tenant1");
//when(this.headersInfo.getPartitionId()).thenReturn("tenant1");
//when(this.sut.getTenantInfo()).thenReturn(info);
......@@ -85,4 +84,4 @@ public class TenantInfoServiceTest {
//assertNotNull(this.sut.getTenantInfo());
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment