Annotation Type PolicyDefinitionDeployment


  • @Target({TYPE,METHOD})
    @Retention(RUNTIME)
    @Documented
    @Inherited
    @Repeatable(PolicyDefinitionDeployments.class)
    public @interface PolicyDefinitionDeployment
    Annotation that can be used to trigger a deployment of policy definitions for the provided test. If no resources() are provided, then a policy definition containing the name of the test class and method would be used to deploy. There are 2 use cases for this annotation:
    • Class level - The policy definitions will be deployed before all tests, and they will be removed after all tests
    • Method level - The policy definitions will be deployed before the test and will be removed after the test
    e.g.
    
     @PolicyDefinitionDeployment
     class YourTest {
    
       @BeforeEach
       void setUp(PolicyEngine policyEngine) {
           ...
       }
    
       @Test
       @PolicyDefinitionDeployment
       void myTest(PolicyRepositoryService repositoryService) {
           ...
       }
    
       ...
     }
     
    • Element Detail

      • resources

        String[] resources
        Default:
        {}
      • tenantId

        String tenantId
        Default:
        ""