Skip to content
Snippets Groups Projects
Commit f8204b25 authored by Koen's avatar Koen
Browse files

Finished tests.

parent ea175785
No related branches found
No related tags found
No related merge requests found
......@@ -523,6 +523,7 @@
<entry key="29211JEGR13699" value="120" />
<entry key="Duration" value="90" />
<entry key="Google&#10; Pixel 6a" value="120" />
<entry key="Pixel_3a_API_33_x86_64" value="120" />
<entry key="Tests" value="360" />
</map>
</option>
......
......@@ -7,11 +7,11 @@
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="$USER_HOME$/.android/avd/Pixel_C_API_33.avd" />
<value value="$USER_HOME$/.android/avd/Pixel_3a_API_33_x86_64.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-08-03T14:42:06.113626110Z" />
<timeTargetWasSelectedWithDropDown value="2023-09-13T07:17:12.576363613Z" />
</component>
</project>
\ No newline at end of file
......@@ -53,6 +53,15 @@ class GenerateTestProfileTests {
assertEquals(claimPointer.toProto().toByteString(), vouchEvent.event.references[0].reference)
}
//Verify resolve claim
val resolveClaimAnyField = ApiMethods.getResolveClaim(TestConstants.SERVER, s2p1.system.toProto(), 2, "UCR7KMD7jkSefYYWgSwNPEBA")
assertEquals(1, resolveClaimAnyField.matchesCount)
assertEquals(s1p1.system, SignedEvent.fromProto(resolveClaimAnyField.getMatches(0).claim).event.system)
val resolveClaimSpecificField = ApiMethods.getResolveClaim(TestConstants.SERVER, s2p1.system.toProto(), 2, 1, "UCR7KMD7jkSefYYWgSwNPEBA")
assertEquals(1, resolveClaimSpecificField.matchesCount)
assertEquals(s1p1.system, SignedEvent.fromProto(resolveClaimSpecificField.getMatches(0).claim).event.system)
Log.i("EXPORT_BUNDLE s1p1", createExportBundle(s1p1))
Log.i("EXPORT_BUNDLE s2p1", createExportBundle(s2p1))
Log.i("verifier pub key", s2p1.system.key.toBase64())
......
......@@ -71,19 +71,19 @@ class ApiMethods {
}
}
suspend fun getResolveClaim(server: String, trustRoot: Protocol.PublicKey, claimType: Long, fieldType: Int, value: String): Protocol.QueryClaimToSystemResponse = withContext(Dispatchers.IO) {
suspend fun getResolveClaim(server: String, trustRoot: Protocol.PublicKey, claimType: Long, claimFieldType: Long, value: String): Protocol.QueryClaimToSystemResponse = withContext(Dispatchers.IO) {
val query = Protocol.QueryClaimToSystemRequest.newBuilder()
.setClaimType(claimType)
.setTrustRoot(trustRoot)
.setMatchAllFields(Protocol.QueryClaimToSystemRequestMatchAll.newBuilder()
.addFields(Protocol.ClaimFieldEntry.newBuilder()
.setKey(fieldType.toLong())
.setKey(claimFieldType.toLong())
.setValue(value)
.build())
.build())
.build().toByteArray().toBase64Url()
val url = "$server/resolve_claim?query=$query"
Log.i("ApiMethods", "getResolveClaim(server = $server, claimType = $claimType, fieldType = $fieldType, value = $value, trustRoot = ${trustRoot.key.toByteArray().toBase64Url()}) URL: $url")
Log.i("ApiMethods", "getResolveClaim(server = $server, claimType = $claimType, claimFieldType = $claimFieldType, value = $value, trustRoot = ${trustRoot.key.toByteArray().toBase64Url()}) URL: $url")
val request = getRequestBuilder(url).get().build()
executeCall(client.newCall(request)) { response ->
if (!response.isSuccessful) {
......
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