'Call ``GET  /credentials?user_id={user_id}&type={type}``.'

def test_list_credentials_filtered_by_type_and_user_id(self):

    user1_id = uuid.uuid4().hex
    user2_id = uuid.uuid4().hex
    credential_user1_ec2 = unit.new_credential_ref(user_id=user1_id, type=CRED_TYPE_EC2)
    credential_user1_cert = unit.new_credential_ref(user_id=user1_id)
    credential_user2_cert = unit.new_credential_ref(user_id=user2_id)
    self.credential_api.create_credential(credential_user1_ec2['id'], credential_user1_ec2)
    self.credential_api.create_credential(credential_user1_cert['id'], credential_user1_cert)
    self.credential_api.create_credential(credential_user2_cert['id'], credential_user2_cert)
    r = self.get(('/credentials?user_id=%s&type=ec2' % user1_id))
    self.assertValidCredentialListResponse(r, ref=credential_user1_ec2)
    self.assertThat(r.result['credentials'], matchers.HasLength(1))
    cred = r.result['credentials'][0]
    self.assertEqual(CRED_TYPE_EC2, cred['type'])
    self.assertEqual(user1_id, cred['user_id'])
