use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.Configuration in project FortniteAPI by Xilixir.
the class Example method main.
public static void main(String[] args) {
Configuration login = new Configuration("login", Credentials.class);
Credentials credentials = login.read();
FortniteAPI api = new FortniteAPI(credentials);
try {
api.authenticate();
} catch (IOException e) {
e.printStackTrace();
}
try {
EpicLookup lookup = api.getUserInfo("bad.player");
Friend[] friends = api.getFriendListData(lookup.getId());
for (Friend friend : friends) {
if (friend.getStatus() == Status.PENDING && friend.getDirection() == Direction.INBOUND) {
System.out.println("attempting to delete friend: " + new Gson().toJson(friend));
api.deleteFriendRequest(lookup.getId(), friend.getAccountId());
}
}
System.out.println(new Gson().toJson(friends));
} catch (IOException e) {
e.printStackTrace();
}
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.Configuration in project bitflyer4j by after-the-sunrise.
the class KeyTypeTest method testFetch_Unconfigured.
@Test
public void testFetch_Unconfigured() throws ConfigurationException {
Configuration c = new MapConfiguration(new HashMap<>());
for (KeyType type : KeyType.values()) {
type.fetch(null);
type.fetch(c);
}
}
use of de.tudarmstadt.ukp.clarin.webanno.curation.casdiff.CasDiff2.Configuration in project bitflyer4j by after-the-sunrise.
the class Bitflyer4jFactoryTest method testCreateConfiguration.
@Test
public void testCreateConfiguration() throws Exception {
Properties properties = new Properties();
Configuration conf = target.createConfiguration(properties);
for (Object name : Collections.list(System.getProperties().propertyNames())) {
// All system properties must exist.
assertTrue(conf.containsKey(name.toString()), "Missing system : " + name);
}
Configuration v = new Configurations().properties(getResource(ConfigurationType.VERSION.getPath()));
Configuration s = new Configurations().properties(getResource(ConfigurationType.SITE.getPath()));
// 1st should be version.
assertEquals(VERSION.fetch(conf), v.getString(VERSION.getKey()));
assertNotEquals(VERSION.fetch(conf), s.getString(VERSION.getKey()));
assertEquals(s.getString(VERSION.getKey()), "test");
// 2nd should be system. (Should not be overridden.)
String system = "java.version";
assertEquals(conf.getString(system), System.getProperty(system));
assertNotEquals(conf.getString(system), s.getString(system));
assertEquals(s.getString(system), "test");
// 3rd should be site.
assertEquals(SITE.fetch(conf), s.getString(SITE.getKey()));
assertEquals(s.getString(SITE.getKey()), "test");
// Last should be default.
assertEquals(HTTP_URL.fetch(conf), HTTP_URL.getDefaultValue());
// Specific
properties.setProperty(HTTP_URL.getKey(), "test");
assertEquals(HTTP_URL.fetch(conf), "test");
}
Aggregations