當前位置: 首頁>>代碼示例>>Java>>正文


Java Api.UNSPECIFIED_STRING_FOR_LIST屬性代碼示例

本文整理匯總了Java中com.google.api.server.spi.config.Api.UNSPECIFIED_STRING_FOR_LIST屬性的典型用法代碼示例。如果您正苦於以下問題:Java Api.UNSPECIFIED_STRING_FOR_LIST屬性的具體用法?Java Api.UNSPECIFIED_STRING_FOR_LIST怎麽用?Java Api.UNSPECIFIED_STRING_FOR_LIST使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.google.api.server.spi.config.Api的用法示例。


在下文中一共展示了Api.UNSPECIFIED_STRING_FOR_LIST屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testSetScopesIfSpecified_unspecified

@Test
public void testSetScopesIfSpecified_unspecified() throws Exception {
  testDefaults();

  annotationConfig.setScopesIfSpecified(null);
  testDefaults();

  String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST};
  annotationConfig.setScopesIfSpecified(unspecified);
  testDefaults();

  String[] scopes = {"bleh", "more bleh"};
  annotationConfig.setScopesIfSpecified(scopes);
  annotationConfig.setScopesIfSpecified(unspecified);
  assertEquals(toScopeExpression(scopes), config.getScopeExpression());
}
 
開發者ID:cloudendpoints,項目名稱:endpoints-java,代碼行數:16,代碼來源:ApiMethodAnnotationConfigTest.java

示例2: testSetAudiencesIfSpecified_unspecified

@Test
public void testSetAudiencesIfSpecified_unspecified() throws Exception {
  testDefaults();

  annotationConfig.setAudiencesIfSpecified(null);
  testDefaults();

  String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST};
  annotationConfig.setAudiencesIfSpecified(unspecified);
  testDefaults();

  String[] audiences = {"bleh", "more bleh"};
  annotationConfig.setAudiencesIfSpecified(audiences);
  annotationConfig.setAudiencesIfSpecified(unspecified);
  assertEquals(Arrays.asList(audiences), config.getAudiences());
}
 
開發者ID:cloudendpoints,項目名稱:endpoints-java,代碼行數:16,代碼來源:ApiMethodAnnotationConfigTest.java

示例3: testSetClientIdsIfSpecified_unspecified

@Test
public void testSetClientIdsIfSpecified_unspecified() throws Exception {
  testDefaults();

  annotationConfig.setClientIdsIfSpecified(null);
  testDefaults();

  String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST};
  annotationConfig.setClientIdsIfSpecified(unspecified);
  testDefaults();

  String[] clientIds = {"bleh", "more bleh"};
  annotationConfig.setClientIdsIfSpecified(clientIds);
  annotationConfig.setClientIdsIfSpecified(unspecified);
  assertEquals(Arrays.asList(clientIds), config.getClientIds());
}
 
開發者ID:cloudendpoints,項目名稱:endpoints-java,代碼行數:16,代碼來源:ApiMethodAnnotationConfigTest.java

示例4: testSetScopesIfSpecified_unspecified

@Test
public void testSetScopesIfSpecified_unspecified() throws Exception {
  String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST};

  EndpointMethod method = getResultNoParamsMethod();
  annotationConfig.setScopesIfSpecified(unspecified);
  ApiMethodConfig methodConfig = config.getApiClassConfig().getMethods().getOrCreate(method);
  assertEquals(toScopeExpression(Constant.API_EMAIL_SCOPE), methodConfig.getScopeExpression());

  String[] scopes = {"bleh", "more bleh"};
  annotationConfig.setScopesIfSpecified(scopes);
  annotationConfig.setScopesIfSpecified(null);
  assertEquals(toScopeExpression(scopes), config.getScopeExpression());

  annotationConfig.setScopesIfSpecified(scopes);
  annotationConfig.setScopesIfSpecified(unspecified);
  assertEquals(toScopeExpression(scopes), config.getScopeExpression());
}
 
開發者ID:cloudendpoints,項目名稱:endpoints-java,代碼行數:18,代碼來源:ApiAnnotationConfigTest.java

示例5: testSetAudiencesIfSpecified_unspecified

@Test
public void testSetAudiencesIfSpecified_unspecified() throws Exception {
  String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST};

  EndpointMethod method = getResultNoParamsMethod();
  annotationConfig.setScopesIfSpecified(unspecified);
  ApiMethodConfig methodConfig = config.getApiClassConfig().getMethods().getOrCreate(method);
  assertEquals(Collections.emptyList(), methodConfig.getAudiences());

  String[] audiences = {"bleh", "more bleh"};
  annotationConfig.setAudiencesIfSpecified(audiences);
  annotationConfig.setAudiencesIfSpecified(null);
  assertEquals(Arrays.asList(audiences), config.getAudiences());

  annotationConfig.setAudiencesIfSpecified(audiences);
  annotationConfig.setAudiencesIfSpecified(unspecified);
  assertEquals(Arrays.asList(audiences), config.getAudiences());
}
 
開發者ID:cloudendpoints,項目名稱:endpoints-java,代碼行數:18,代碼來源:ApiAnnotationConfigTest.java

示例6: testSetClientIdsIfSpecified_unspecified

@Test
public void testSetClientIdsIfSpecified_unspecified() throws Exception {
  String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST};

  EndpointMethod method = getResultNoParamsMethod();
  annotationConfig.setScopesIfSpecified(unspecified);
  ApiMethodConfig methodConfig = config.getApiClassConfig().getMethods().getOrCreate(method);
  assertEquals(ImmutableList.of(Constant.API_EXPLORER_CLIENT_ID), methodConfig.getClientIds());

  String[] clientIds = {"bleh", "more bleh"};
  annotationConfig.setClientIdsIfSpecified(clientIds);
  annotationConfig.setClientIdsIfSpecified(null);
  assertEquals(Arrays.asList(clientIds), config.getClientIds());

  annotationConfig.setClientIdsIfSpecified(clientIds);
  annotationConfig.setClientIdsIfSpecified(unspecified);
  assertEquals(Arrays.asList(clientIds), config.getClientIds());
}
 
開發者ID:cloudendpoints,項目名稱:endpoints-java,代碼行數:18,代碼來源:ApiAnnotationConfigTest.java

示例7: testSetScopesIfSpecified_unspecified

@Test
public void testSetScopesIfSpecified_unspecified() throws Exception {
  annotationConfig.setScopesIfSpecified(null);
  Mockito.verifyZeroInteractions(config);

  String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST};
  annotationConfig.setScopesIfSpecified(unspecified);
  Mockito.verifyZeroInteractions(config);

  String[] scopes = { "bleh", "more bleh" };
  annotationConfig.setScopesIfSpecified(scopes);
  annotationConfig.setScopesIfSpecified(unspecified);
  Mockito.verify(config).setScopeExpression(toScopeExpression(scopes));
  Mockito.verifyNoMoreInteractions(config);
}
 
開發者ID:cloudendpoints,項目名稱:endpoints-java,代碼行數:15,代碼來源:ApiClassAnnotationConfigTest.java

示例8: testSetAudiencesIfSpecified_unspecified

@Test
public void testSetAudiencesIfSpecified_unspecified() throws Exception {
  annotationConfig.setAudiencesIfSpecified(null);
  Mockito.verifyZeroInteractions(config);

  String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST};
  annotationConfig.setAudiencesIfSpecified(unspecified);
  Mockito.verifyZeroInteractions(config);

  String[] audiences = {"bleh", "more bleh"};
  annotationConfig.setAudiencesIfSpecified(audiences);
  annotationConfig.setAudiencesIfSpecified(unspecified);
  Mockito.verify(config).setAudiences(Arrays.asList(audiences));
  Mockito.verifyNoMoreInteractions(config);
}
 
開發者ID:cloudendpoints,項目名稱:endpoints-java,代碼行數:15,代碼來源:ApiClassAnnotationConfigTest.java

示例9: testSetClientIdsIfSpecified_unspecified

@Test
public void testSetClientIdsIfSpecified_unspecified() throws Exception {
  annotationConfig.setClientIdsIfSpecified(null);
  Mockito.verifyZeroInteractions(config);

  String[] unspecified = {Api.UNSPECIFIED_STRING_FOR_LIST};
  annotationConfig.setClientIdsIfSpecified(unspecified);
  Mockito.verifyZeroInteractions(config);

  String[] clientIds = {"bleh", "more bleh"};
  annotationConfig.setClientIdsIfSpecified(clientIds);
  annotationConfig.setClientIdsIfSpecified(unspecified);
  Mockito.verify(config).setClientIds(Arrays.asList(clientIds));
  Mockito.verifyNoMoreInteractions(config);
}
 
開發者ID:cloudendpoints,項目名稱:endpoints-java,代碼行數:15,代碼來源:ApiClassAnnotationConfigTest.java


注:本文中的com.google.api.server.spi.config.Api.UNSPECIFIED_STRING_FOR_LIST屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。