本文整理匯總了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);
}