From cd42f1d6895befbd1374cf4f2893c8e3471df14d Mon Sep 17 00:00:00 2001 From: rmarinn <34529290+rmarinn@users.noreply.github.com> Date: Sat, 28 Dec 2024 03:11:01 +0800 Subject: [PATCH] fix(jans-cedarling): broken tests - fix the broken tests due to removing the creation of workload entity using the userinfo token Signed-off-by: rmarinn <34529290+rmarinn@users.noreply.github.com> --- .../cedarling/src/authz/entities/workload.rs | 2 +- .../cedarling/src/tests/mapping_entities.rs | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/jans-cedarling/cedarling/src/authz/entities/workload.rs b/jans-cedarling/cedarling/src/authz/entities/workload.rs index 7773b09d284..6ce1acafb8a 100644 --- a/jans-cedarling/cedarling/src/authz/entities/workload.rs +++ b/jans-cedarling/cedarling/src/authz/entities/workload.rs @@ -232,7 +232,7 @@ mod test { let result = create_workload_entity(entity_mapping, &policy_store, &tokens) .expect_err("expected to error while creating workload entity"); - assert_eq!(result.errors.len(), 3); + assert_eq!(result.errors.len(), 2); for (_tkn_kind, err) in result.errors.iter() { assert!( matches!(err, CreateCedarEntityError::UnavailableToken), diff --git a/jans-cedarling/cedarling/src/tests/mapping_entities.rs b/jans-cedarling/cedarling/src/tests/mapping_entities.rs index e60c8399dc2..97878ca393e 100644 --- a/jans-cedarling/cedarling/src/tests/mapping_entities.rs +++ b/jans-cedarling/cedarling/src/tests/mapping_entities.rs @@ -224,7 +224,7 @@ fn test_failed_workload_mapping() { match err { AuthorizeError::CreateWorkloadEntity(error) => { - assert_eq!(error.errors.len(), 3, "there should be 3 errors"); + assert_eq!(error.errors.len(), 2, "there should be 2 errors"); // check for access token error let (token_kind, err) = &error.errors[0]; @@ -245,15 +245,6 @@ fn test_failed_workload_mapping() { &entity_type, err, ); - - // check for userinfo token error - let (token_kind, err) = &error.errors[2]; - assert_eq!(token_kind, &TokenKind::Userinfo); - assert!( - matches!(err, CreateCedarEntityError::MissingClaim(ref claim) if claim == "aud"), - "expected MissinClaim(\"aud\"), got: {:?}", - err - ); }, _ => panic!("expected error CreateWorkloadEntity"), }