5454import org .apache .polaris .service .config .DefaultConfigurationStore ;
5555import org .junit .jupiter .api .BeforeEach ;
5656import org .junit .jupiter .api .Test ;
57- import org .junit .jupiter .params .ParameterizedTest ;
58- import org .junit .jupiter .params .provider .MethodSource ;
5957import org .mockito .Mockito ;
6058
6159public class ManagementServiceTest {
@@ -225,12 +223,8 @@ public String getAuthenticationScheme() {
225223 }
226224
227225 private PrincipalEntity createPrincipal (
228- PolarisMetaStoreManager metaStoreManager ,
229- PolarisCallContext callContext ,
230- String name ,
231- boolean isFederated ) {
226+ PolarisMetaStoreManager metaStoreManager , PolarisCallContext callContext , String name ) {
232227 return new PrincipalEntity .Builder ()
233- .setFederated (isFederated )
234228 .setName (name )
235229 .setCreateTimestamp (Instant .now ().toEpochMilli ())
236230 .setId (metaStoreManager .generateNewEntityId (callContext ).getId ())
@@ -252,32 +246,17 @@ private PrincipalRoleEntity createRole(
252246 .build ();
253247 }
254248
255- public static Object [][] federatedIdentityArugments () {
256- return new Object [][] {
257- {true , false },
258- {false , true },
259- {true , true },
260- };
261- }
262-
263- @ ParameterizedTest
264- @ MethodSource ("federatedIdentityArugments" )
265- public void testCannotAssignFederatedEntities (
266- boolean isFederatedPrincipal , boolean isFederatedRole ) {
249+ @ Test
250+ public void testCannotAssignFederatedEntities () {
267251 PolarisMetaStoreManager metaStoreManager = setupMetaStoreManager ();
268252 PolarisCallContext callContext = setupCallContext (metaStoreManager );
269253 PolarisAdminService polarisAdminService =
270254 setupPolarisAdminService (metaStoreManager , callContext );
271255
272- String principalPrefix = isFederatedPrincipal ? "federated_" : "" ;
273- PrincipalEntity principal =
274- createPrincipal (
275- metaStoreManager , callContext , principalPrefix + "principal_id" , isFederatedPrincipal );
256+ PrincipalEntity principal = createPrincipal (metaStoreManager , callContext , "principal_id" );
276257 metaStoreManager .createPrincipal (callContext , principal );
277258
278- String rolePrefix = isFederatedRole ? "federated_" : "" ;
279- PrincipalRoleEntity role =
280- createRole (metaStoreManager , callContext , rolePrefix + "role_id" , isFederatedRole );
259+ PrincipalRoleEntity role = createRole (metaStoreManager , callContext , "federated_role_id" , true );
281260 EntityResult result = metaStoreManager .createEntityIfNotExists (callContext , null , role );
282261 assertThat (result .isSuccess ()).isTrue ();
283262
0 commit comments