@Test
  public void testNoFallbackEvenIfPreferred() throws Exception {
    Provider p = Conscrypt.newProvider();
    Security.addProvider(p);

    for (Provider provider : Security.getProviders()) {
      List<Provider> preferredProviders = EngineFactory.toProviderList(provider.getName());
      // Conscrypt does not provide "AES", so this must fail and not use the preferred provider.
      assertThrows(
          GeneralSecurityException.class,
          () -> EngineFactory.CIPHER.getInstance("AES", preferredProviders));
    }
  }
Tests for EngineFactory when Tink is build in FIPS-mode.
java_src/src/test/java/com/google/crypto/tink/subtle/EngineFactoryFipsTest.java