本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}