Java Code Examples for com.google.api.server.spi.config.Api#UNSPECIFIED_STRING_FOR_LIST
The following examples show how to use
com.google.api.server.spi.config.Api#UNSPECIFIED_STRING_FOR_LIST .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApiMethodAnnotationConfigTest.java From endpoints-java with Apache License 2.0 | 6 votes |
@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()); }
Example 2
Source File: ApiMethodAnnotationConfigTest.java From endpoints-java with Apache License 2.0 | 6 votes |
@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()); }
Example 3
Source File: ApiMethodAnnotationConfigTest.java From endpoints-java with Apache License 2.0 | 6 votes |
@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()); }
Example 4
Source File: ApiAnnotationConfigTest.java From endpoints-java with Apache License 2.0 | 6 votes |
@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()); }
Example 5
Source File: ApiAnnotationConfigTest.java From endpoints-java with Apache License 2.0 | 6 votes |
@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()); }
Example 6
Source File: ApiAnnotationConfigTest.java From endpoints-java with Apache License 2.0 | 6 votes |
@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()); }
Example 7
Source File: ApiClassAnnotationConfigTest.java From endpoints-java with Apache License 2.0 | 5 votes |
@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); }
Example 8
Source File: ApiClassAnnotationConfigTest.java From endpoints-java with Apache License 2.0 | 5 votes |
@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); }
Example 9
Source File: ApiClassAnnotationConfigTest.java From endpoints-java with Apache License 2.0 | 5 votes |
@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); }