当前位置: 首页>>代码示例>>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;未经允许,请勿转载。