@Test
void canConvertTest() {

    Element policyElement = createPolicy(createJSAssertion("myPolicy", "", false, "my-javascript"));
    //success
    assertTrue(assertionJSPolicyConverter.canConvert("myPolicy", policyElement));
    // fail - different policy name
    assertFalse(assertionJSPolicyConverter.canConvert("someOtherPolicyName", policyElement));
    //fail - custom execution time
    policyElement = createPolicy(createJSAssertion("myPolicy", "123", false, "my-javascript"));
    assertFalse(assertionJSPolicyConverter.canConvert("myPolicy", policyElement));
    // fail - script is attribute
    policyElement = createPolicy(createJSAssertion("myPolicy", "", true, "my-javascript"));
    assertFalse(assertionJSPolicyConverter.canConvert("myPolicy", policyElement));
    // fail - more then just a single js assertion
    policyElement = createPolicy(createJSAssertion("myPolicy", "", false, "my-javascript"), document.createElement("L7p:SomeOtherAssertion"));
    assertFalse(assertionJSPolicyConverter.canConvert("myPolicy", policyElement));
    // fail - no assertions
    policyElement = createPolicy();
    assertFalse(assertionJSPolicyConverter.canConvert("myPolicy", policyElement));
    // fail - not js assertion
    policyElement = createPolicy(document.createElement("L7p:SomeOtherAssertion"));
    assertFalse(assertionJSPolicyConverter.canConvert("myPolicy", policyElement));
}