diff --git a/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/WatsonServiceTest.java b/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/WatsonServiceTest.java index 6fd02e932..21bacb04a 100755 --- a/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/WatsonServiceTest.java +++ b/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/WatsonServiceTest.java @@ -17,6 +17,7 @@ import java.util.Properties; import com.ibm.cloud.sdk.core.http.HttpConfigOptions; +import com.ibm.cloud.sdk.core.security.BearerTokenAuthenticator; import com.ibm.cloud.sdk.core.security.IamAuthenticator; import com.ibm.cloud.sdk.core.security.NoAuthAuthenticator; import com.ibm.watson.health.acd.v1.common.Constants; @@ -87,7 +88,14 @@ private void loadProperties() { */ public void setUp() throws Exception { - if ((getProperty(Constants.APIKEY) == null) || getProperty(Constants.APIKEY).trim().length() == 0) { + if (getProperty(Constants.BEARER_TOKEN) != null) { + service = new AnnotatorForClinicalData(getProperty(Constants.VERSION), + "AnnotatorForClinicalData", new BearerTokenAuthenticator(getProperty(Constants.BEARER_TOKEN))); + service.setServiceUrl(getProperty(Constants.URL)); + HttpConfigOptions options = new HttpConfigOptions.Builder().disableSslVerification(true).build(); + service.configureClient(options); + } + else if ((getProperty(Constants.APIKEY) == null) || getProperty(Constants.APIKEY).trim().length() == 0) { service = new AnnotatorForClinicalData(getProperty(Constants.VERSION), "AnnotatorForClinicalData", new NoAuthAuthenticator()); service.setServiceUrl(getProperty(Constants.URL)); diff --git a/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/common/Constants.java b/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/common/Constants.java index 1bf07f350..1c835a045 100644 --- a/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/common/Constants.java +++ b/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/common/Constants.java @@ -14,6 +14,7 @@ public class Constants { public static final String URL = "URL"; + public static final String BEARER_TOKEN = "BEARER_TOKEN"; public static final String APIKEY = "APIKEY"; public static final String VERSION = "VERSION"; public static final String IAM_URL = "IAM_URL"; diff --git a/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/common/TestTemporal.java b/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/common/TestTemporal.java index 08c0b93d8..68962601b 100644 --- a/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/common/TestTemporal.java +++ b/modules/annotator-for-clinical-data/src/test/java/com/ibm/watson/health/acd/v1/common/TestTemporal.java @@ -28,10 +28,9 @@ public static void testTemporal(Temporal annotation) { CustomCollection temporalType = annotation.getTemporalType(); TestCustomCollection.testCustomCollectionByName(temporalType, "dateScore"); @SuppressWarnings("unchecked") - Map temporalTypeMap = (Map)annotation.getTemporalTypeMap(); - for (Map.Entry entry : temporalTypeMap.entrySet()) { + Map temporalTypeMap = (Map)annotation.getTemporalTypeMap(); + for (Map.Entry entry : temporalTypeMap.entrySet()) { Assert.assertTrue(entry.getKey() != null); - Assert.assertTrue(entry.getValue() >= 0); } //Map temporalTypeMap = annotation.getTemporalTypeMap(); //if (!temporalTypeMap.isEmpty()) { diff --git a/pom.xml b/pom.xml index 40c6947f2..c2f84cb77 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ - 9.14.1 + 9.17.4 UTF-8