@GET
 @AnonymousAllowed
 @Path("option/set")
 public Response setOption(@QueryParam("key") String key, @QueryParam("value") boolean value) {
   applicationProperties.setOption(key, value);
   return Response.ok(null).build();
 }
  @Test
  public void testGetLicenseExpiryStatusMessageForExpiredEvaluation() {
    mockLicense.setEvaluation(true);
    mockLicense.setExpiryDate(now);
    mockLicense.setExpired(true);

    applicationProperties.setOption(APKeys.JIRA_CONFIRMED_INSTALL_WITH_OLD_LICENSE, true);

    assertExpiryMessageContains("admin.license.expired");
  }
  @Test
  public void testExternalUserManagementNoOsUser() throws Exception {
    applicationProperties.setOption(APKeys.JIRA_OPTION_USER_EXTERNALMGT, true);
    UpgradeTask_Build601 task = new MyUpgradeTask_Build601(null, false, applicationProperties);

    task.doUpgrade(false);
    Collection<String> errors = task.getErrors();

    assertEquals(1, errors.size());
    assertTrue(
        errors
            .iterator()
            .next()
            .contains(
                "JIRA is unable to migrate the User Directory configuration because external user management is enabled but the osuser.xml file is not available."));
  }
 private void setLicenseExtenstionTimestamp(final long timestamp) {
   applicationProperties.setOption(APKeys.JIRA_CONFIRMED_INSTALL_WITH_OLD_LICENSE, true);
   applicationProperties.setString(
       APKeys.JIRA_CONFIRMED_INSTALL_WITH_OLD_LICENSE_TIMESTAMP, String.valueOf(timestamp));
 }