@Test
  public void testFipsEnablingAtRuntime_worksWhenFipsModuleIsAvailable()
      throws GeneralSecurityException {
    // If Tink has not been built in FIPS-mode, then the useOnlyFips() call should only return
    // true after the restrictions have been enabled.
    Assume.assumeFalse(TinkFipsUtil.useOnlyFips());
    Assume.assumeTrue(TinkFipsUtil.fipsModuleAvailable());

    assertThat(TinkFips.useOnlyFips()).isFalse();
    TinkFips.restrictToFips();
    assertThat(TinkFips.useOnlyFips()).isTrue();
  }
Tests for TinkFips. The tests here check the behavior of Tink when built with or without the
--use_only_fips flag. In order to get complete coverage a build should be tested with: 1) Build
without the --use_only_fips flag. 2) Build with the --use_only_fips flag, and BoringCrypto not
being available. 3) Build with the --use_only_fips flag, and BoringCrypto being available.
java_src/src/test/java/com/google/crypto/tink/config/TinkFipsTest.java