@Test
public void testSetAuthLevelIfSpecified_unspecified() throws Exception {

  EndpointMethod method = getResultNoParamsMethod();
  annotationConfig.setAuthLevelIfSpecified(AuthLevel.UNSPECIFIED);
  ApiMethodConfig methodConfig = config.getApiClassConfig().getMethods().getOrCreate(method);
  assertEquals(AuthLevel.NONE, methodConfig.getAuthLevel());
  annotationConfig.setAuthLevelIfSpecified(AuthLevel.REQUIRED);
  assertEquals(AuthLevel.REQUIRED, config.getAuthLevel());
  annotationConfig.setAuthLevelIfSpecified(AuthLevel.UNSPECIFIED);
  assertEquals(AuthLevel.REQUIRED, config.getAuthLevel());
}