mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-20 17:33:08 +00:00
Add test api to return dummy identities
This commit is contained in:
parent
bdc1db0090
commit
82ad628c50
@ -29,6 +29,8 @@ import org.servalproject.servaldna.SubscriberId;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
import java.util.Map;
|
||||
|
||||
@ -80,6 +82,25 @@ public class KeyringIdentityList {
|
||||
}
|
||||
}
|
||||
|
||||
public static List<KeyringIdentity> getTestIdentities() {
|
||||
try {
|
||||
List<KeyringIdentity> ret = new ArrayList<>();
|
||||
byte[] sid = new byte[SubscriberId.BINARY_SIZE];
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
sid[0]=(byte)i;
|
||||
ret.add(new KeyringIdentity(
|
||||
i,
|
||||
new SubscriberId(sid),
|
||||
"555000" + i,
|
||||
"Agent " + i));
|
||||
}
|
||||
return ret;
|
||||
}catch (Exception e){
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public KeyringIdentity nextIdentity() throws ServalDInterfaceException, IOException
|
||||
{
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user