54
54
import org .apache .polaris .service .config .DefaultConfigurationStore ;
55
55
import org .junit .jupiter .api .BeforeEach ;
56
56
import org .junit .jupiter .api .Test ;
57
- import org .junit .jupiter .params .ParameterizedTest ;
58
- import org .junit .jupiter .params .provider .MethodSource ;
59
57
import org .mockito .Mockito ;
60
58
61
59
public class ManagementServiceTest {
@@ -225,12 +223,8 @@ public String getAuthenticationScheme() {
225
223
}
226
224
227
225
private PrincipalEntity createPrincipal (
228
- PolarisMetaStoreManager metaStoreManager ,
229
- PolarisCallContext callContext ,
230
- String name ,
231
- boolean isFederated ) {
226
+ PolarisMetaStoreManager metaStoreManager , PolarisCallContext callContext , String name ) {
232
227
return new PrincipalEntity .Builder ()
233
- .setFederated (isFederated )
234
228
.setName (name )
235
229
.setCreateTimestamp (Instant .now ().toEpochMilli ())
236
230
.setId (metaStoreManager .generateNewEntityId (callContext ).getId ())
@@ -252,32 +246,17 @@ private PrincipalRoleEntity createRole(
252
246
.build ();
253
247
}
254
248
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 () {
267
251
PolarisMetaStoreManager metaStoreManager = setupMetaStoreManager ();
268
252
PolarisCallContext callContext = setupCallContext (metaStoreManager );
269
253
PolarisAdminService polarisAdminService =
270
254
setupPolarisAdminService (metaStoreManager , callContext );
271
255
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" );
276
257
metaStoreManager .createPrincipal (callContext , principal );
277
258
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 );
281
260
EntityResult result = metaStoreManager .createEntityIfNotExists (callContext , null , role );
282
261
assertThat (result .isSuccess ()).isTrue ();
283
262
0 commit comments