@@ -25,6 +25,7 @@ public void testValidCertOneTransport() throws Exception {
2525
2626 assertNotNull (attestation );
2727 List <Transports > transports = attestation .getTransports ();
28+ assertNotNull (transports );
2829 assertEquals (1 , transports .size ());
2930 assertTrue (transports .contains (Transports .BLUETOOTH_BREDR ));
3031 }
@@ -34,12 +35,11 @@ public void testMalformedCert() throws Exception {
3435 U2fAttestation .Parse (TRUSTED_CERTIFICATE_MALFORMED_TRANSPORTS_EXTENSION );
3536 }
3637
37- // There is no Transports Extension in the attestation cert
38- // and the current behavior is to throw (the ServerImplementation code catches).
39- // TODO(aczeskis): change behavior of ServerImplementation and update test
40- @ Test (expected = CertificateParsingException .class )
38+ @ Test
4139 public void testValidCertNoTransports () throws Exception {
42- U2fAttestation .Parse (TRUSTED_CERTIFICATE_2 );
40+ U2fAttestation attestation = U2fAttestation .Parse (TRUSTED_CERTIFICATE_2 );
41+ assertNotNull (attestation );
42+ assertTrue (attestation .getTransports () == null );
4343 }
4444
4545 @ Test
@@ -48,6 +48,7 @@ public void testValidCertMultipleTransports() throws Exception {
4848
4949 assertNotNull (attestation );
5050 List <Transports > transports = attestation .getTransports ();
51+ assertNotNull (transports );
5152 assertEquals (3 , transports .size ());
5253 assertTrue (transports .contains (Transports .BLUETOOTH_BREDR ));
5354 assertTrue (transports .contains (Transports .BLUETOOTH_LOW_ENERGY ));
0 commit comments