import java.util.Date;
import java.util.List;
+import org.onap.aaf.cadi.Access.Level;
import org.onap.aaf.cadi.CadiException;
import org.onap.aaf.cadi.Locator;
+import org.onap.aaf.cadi.Locator.Item;
import org.onap.aaf.cadi.LocatorException;
import org.onap.aaf.cadi.PropAccess;
import org.onap.aaf.cadi.SecuritySetter;
-import org.onap.aaf.cadi.Access.Level;
-import org.onap.aaf.cadi.Locator.Item;
import org.onap.aaf.cadi.aaf.v2_0.AAFLocator;
import org.onap.aaf.cadi.client.Future;
import org.onap.aaf.cadi.config.Config;
System.out.println("Usage: ConnectivityTester <cadi_prop_files> [<AAF FQDN (i.e. aaf.dev.att.com)>]");
} else {
print(true,"START OF CONNECTIVITY TESTS",new Date().toString(),System.getProperty("user.name"),
- "Note: All API Calls are /authz/perms/user/<MechID/Alias of the caller>");
+ "Note: All API Calls are /authz/perms/user/<AppID/Alias of the caller>");
if(!args[0].contains(Config.CADI_PROP_FILES+'=')) {
args[0]=Config.CADI_PROP_FILES+'='+args[0];
PropAccess access = new PropAccess(args);
String aaflocate;
if(args.length>1) {
- aaflocate = "https://" + args[1] + "/locate";
+ aaflocate = "https://" + args[1];
access.setProperty(Config.AAF_LOCATE_URL, "https://" + args[1]);
} else {
aaflocate = access.getProperty(Config.AAF_LOCATE_URL);
List<SecuritySetter<HttpURLConnection>> lss = loadSetters(access,si);
/////////
print(true,"Test Connections driven by AAFLocator");
- URI serviceURI = new URI(aaflocate+"/AAF_NS.service/2.0");
+ URI serviceURI = new URI(Defaults.AAF_URL);
for(URI uri : new URI[] {
serviceURI,
- new URI(aaflocate+"/AAF_NS.service:2.0"),
- new URI(aaflocate+"/AAF_NS.service"),
- new URI(aaflocate+"/AAF_NS.gw:2.0"),
- new URI(aaflocate+"/AAF_NS.token:2.0"),
- new URI(aaflocate+"/AAF_NS.certman:2.0"),
- new URI(aaflocate+"/AAF_NS.hello")
+ new URI(Defaults.OAUTH2_TOKEN_URL),
+ new URI(Defaults.OAUTH2_INTROSPECT_URL),
+ new URI(Defaults.CM_URL),
+ new URI(Defaults.GUI_URL),
+ new URI(Defaults.FS_URL),
+ new URI(Defaults.HELLO_URL)
}) {
Locator<URI> locator = new AAFLocator(si, uri);
try {
}
/////////
- print(true,"Test Service driven by AAFLocator");
- Locator<URI> locator = new AAFLocator(si,new URI(aaflocate+"/AAF_NS.service:2.0"));
- for(SecuritySetter<HttpURLConnection> ss : lss) {
- permTest(locator,ss);
- }
-
- /////////
- print(true,"Test Proxy Access driven by AAFLocator");
- locator = new AAFLocator(si, new URI(aaflocate+"/AAF_NS.gw:2.0/proxy"));
+ print(true,"Test Service for Perms driven by AAFLocator");
+ Locator<URI> locator = new AAFLocator(si,serviceURI);
for(SecuritySetter<HttpURLConnection> ss : lss) {
permTest(locator,ss);
}
print(true,"Test essential BasicAuth Service call, driven by AAFLocator");
for(SecuritySetter<HttpURLConnection> ss : lss) {
if(ss instanceof HBasicAuthSS) {
- basicAuthTest(new AAFLocator(si, new URI(aaflocate+"/AAF_NS.service:2.0")),ss);
+ basicAuthTest(new AAFLocator(si, serviceURI),ss);
}
}
print(true,"Load Security Setters from Configuration Information");
String user = access.getProperty(Config.AAF_APPID);
- ArrayList<SecuritySetter<HttpURLConnection>> lss = new ArrayList<SecuritySetter<HttpURLConnection>>();
+ ArrayList<SecuritySetter<HttpURLConnection>> lss = new ArrayList<>();
try {
String tokenURL = access.getProperty(Config.AAF_OAUTH2_TOKEN_URL);
String locateURL=access.getProperty(Config.AAF_LOCATE_URL);
if(tokenURL==null || (tokenURL.contains("/locate/") && locateURL!=null)) {
- tokenURL=locateURL+"/locate/AAF_NS.token:2.0/token";
+ tokenURL=Defaults.OAUTH2_TOKEN_URL+"/token";
}
try {