@Test @SuppressWarnings("all") public void testGetType() throws Exception { String projectId = "02a70003-e864-464e-b62c-e0ede97deb8c"; this.serverBootstrap.registerHandler( String.format("/%s/%s", projectId, "types/coffee"), (request, response, context) -> response.setEntity( new InputStreamEntity( this.getClass().getResourceAsStream("SampleContentType.json") ) )); HttpHost httpHost = this.start(); DeliveryClient client = new DeliveryClient(projectId); String testServerUri = httpHost.toURI(); client.getDeliveryOptions().setProductionEndpoint(testServerUri); ContentType type = client.getType("coffee") .toCompletableFuture() .get(); Assert.assertNotNull(type); }
public CompletionStage<ContentType> getType(String contentTypeCodeName) { final String apiCall = String.format(URL_CONCAT, TYPES, contentTypeCodeName); return executeRequest(apiCall, Collections.emptyList(), ContentType.class); }
DeliveryClient { public CompletionStage<ContentType> getType(String contentTypeCodeName) { final String apiCall = String.format(URL_CONCAT, TYPES, contentTypeCodeName); return executeRequest(apiCall, Collections.emptyList(), ContentType.class); } }
DeliveryClient { public CompletionStage<ContentType> getType(String contentTypeCodeName) { final String apiCall = String.format(URL_CONCAT, TYPES, contentTypeCodeName); return executeRequest(apiCall, Collections.emptyList(), ContentType.class); } @SuppressWarnings("WeakerAccess")  DeliveryClient(DeliveryOptions deliveryOptions); @SuppressWarnings({"ResultOfMethodCallIgnored", "WeakerAccess"})  DeliveryClient(DeliveryOptions deliveryOptions, TemplateEngineConfig templateEngineConfig); @SuppressWarnings("unused")  DeliveryClient(String projectId); @SuppressWarnings("unused")  DeliveryClient(String projectId, String previewApiKey); }
DeliveryClient { public CompletionStage<ContentType> getType(String contentTypeCodeName) { final String apiCall = String.format(URL_CONCAT, TYPES, contentTypeCodeName); return executeRequest(apiCall, Collections.emptyList(), ContentType.class); } @SuppressWarnings("WeakerAccess")  DeliveryClient(DeliveryOptions deliveryOptions); @SuppressWarnings({"ResultOfMethodCallIgnored", "WeakerAccess"})  DeliveryClient(DeliveryOptions deliveryOptions, TemplateEngineConfig templateEngineConfig); @SuppressWarnings("unused")  DeliveryClient(String projectId); @SuppressWarnings("unused")  DeliveryClient(String projectId, String previewApiKey); CompletionStage<ContentItemsListingResponse> getItems(); @SuppressWarnings("WeakerAccess") CompletionStage<ContentItemsListingResponse> getItems(List<NameValuePair> params); @SuppressWarnings("WeakerAccess") CompletionStage<List<T>> getItems(Class<T> tClass, List<NameValuePair> params); @SuppressWarnings("unused") CompletionStage<ContentItemResponse> getItem(String contentItemCodename); @SuppressWarnings("unused") CompletionStage<List<T>> getItems(Class<T> tClass); @SuppressWarnings("WeakerAccess") CompletionStage<Page<T>> getPageOfItems(Class<T> tClass, List<NameValuePair> params); @SuppressWarnings("WeakerAccess") CompletionStage<Page<T>> getNextPage(Page<T> currentPage); @SuppressWarnings("unused") CompletionStage<T> getItem(String contentItemCodename, Class<T> tClass); @SuppressWarnings("WeakerAccess") CompletionStage<ContentItemResponse> getItem(String contentItemCodename, List<NameValuePair> params); @SuppressWarnings("WeakerAccess") CompletionStage<T> getItem(String contentItemCodename, Class<T> tClass, List<NameValuePair> params); CompletionStage<ContentTypesListingResponse> getTypes(); @SuppressWarnings("WeakerAccess") CompletionStage<ContentTypesListingResponse> getTypes(List<NameValuePair> params); CompletionStage<ContentType> getType(String contentTypeCodeName); @SuppressWarnings("unused") CompletionStage<Element> getContentTypeElement(String contentTypeCodeName, String elementCodeName); @SuppressWarnings("WeakerAccess") CompletionStage<Element> getContentTypeElement(
            String contentTypeCodeName, String elementCodeName, List<NameValuePair> params); @SuppressWarnings("unused") CompletionStage<TaxonomyGroupListingResponse> getTaxonomyGroups(); @SuppressWarnings("WeakerAccess") CompletionStage<TaxonomyGroupListingResponse> getTaxonomyGroups(List<NameValuePair> params); @SuppressWarnings("unused") CompletionStage<TaxonomyGroup> getTaxonomyGroup(String taxonomyGroupCodename); @SuppressWarnings("WeakerAccess") CompletionStage<TaxonomyGroup> getTaxonomyGroup(String taxonomyGroupCodename, List<NameValuePair> params); @SuppressWarnings("WeakerAccess") ContentLinkUrlResolver getContentLinkUrlResolver(); @SuppressWarnings("WeakerAccess") void setContentLinkUrlResolver(ContentLinkUrlResolver contentLinkUrlResolver); @SuppressWarnings("WeakerAccess") BrokenLinkUrlResolver getBrokenLinkUrlResolver(); @SuppressWarnings("WeakerAccess") void setBrokenLinkUrlResolver(BrokenLinkUrlResolver brokenLinkUrlResolver); @SuppressWarnings("WeakerAccess") RichTextElementResolver getRichTextElementResolver(); @SuppressWarnings("WeakerAccess") void setRichTextElementResolver(RichTextElementResolver richTextElementResolver); @SuppressWarnings("WeakerAccess") void addRichTextElementResolver(RichTextElementResolver richTextElementResolver); @SuppressWarnings("WeakerAccess") void registerType(String contentType, Class<?> clazz); @SuppressWarnings("WeakerAccess") void registerType(Class<?> clazz); @SuppressWarnings("WeakerAccess") void registerInlineContentItemsResolver(InlineContentItemsResolver resolver); @SuppressWarnings("WeakerAccess") void scanClasspathForMappings(String basePackage); @SuppressWarnings("WeakerAccess") void setCacheManager(AsyncCacheManager cacheManager); void setCacheManager(final CacheManager cacheManager); }
DeliveryClient { public CompletionStage<ContentType> getType(String contentTypeCodeName) { final String apiCall = String.format(URL_CONCAT, TYPES, contentTypeCodeName); return executeRequest(apiCall, Collections.emptyList(), ContentType.class); } @SuppressWarnings("WeakerAccess")  DeliveryClient(DeliveryOptions deliveryOptions); @SuppressWarnings({"ResultOfMethodCallIgnored", "WeakerAccess"})  DeliveryClient(DeliveryOptions deliveryOptions, TemplateEngineConfig templateEngineConfig); @SuppressWarnings("unused")  DeliveryClient(String projectId); @SuppressWarnings("unused")  DeliveryClient(String projectId, String previewApiKey); CompletionStage<ContentItemsListingResponse> getItems(); @SuppressWarnings("WeakerAccess") CompletionStage<ContentItemsListingResponse> getItems(List<NameValuePair> params); @SuppressWarnings("WeakerAccess") CompletionStage<List<T>> getItems(Class<T> tClass, List<NameValuePair> params); @SuppressWarnings("unused") CompletionStage<ContentItemResponse> getItem(String contentItemCodename); @SuppressWarnings("unused") CompletionStage<List<T>> getItems(Class<T> tClass); @SuppressWarnings("WeakerAccess") CompletionStage<Page<T>> getPageOfItems(Class<T> tClass, List<NameValuePair> params); @SuppressWarnings("WeakerAccess") CompletionStage<Page<T>> getNextPage(Page<T> currentPage); @SuppressWarnings("unused") CompletionStage<T> getItem(String contentItemCodename, Class<T> tClass); @SuppressWarnings("WeakerAccess") CompletionStage<ContentItemResponse> getItem(String contentItemCodename, List<NameValuePair> params); @SuppressWarnings("WeakerAccess") CompletionStage<T> getItem(String contentItemCodename, Class<T> tClass, List<NameValuePair> params); CompletionStage<ContentTypesListingResponse> getTypes(); @SuppressWarnings("WeakerAccess") CompletionStage<ContentTypesListingResponse> getTypes(List<NameValuePair> params); CompletionStage<ContentType> getType(String contentTypeCodeName); @SuppressWarnings("unused") CompletionStage<Element> getContentTypeElement(String contentTypeCodeName, String elementCodeName); @SuppressWarnings("WeakerAccess") CompletionStage<Element> getContentTypeElement(
            String contentTypeCodeName, String elementCodeName, List<NameValuePair> params); @SuppressWarnings("unused") CompletionStage<TaxonomyGroupListingResponse> getTaxonomyGroups(); @SuppressWarnings("WeakerAccess") CompletionStage<TaxonomyGroupListingResponse> getTaxonomyGroups(List<NameValuePair> params); @SuppressWarnings("unused") CompletionStage<TaxonomyGroup> getTaxonomyGroup(String taxonomyGroupCodename); @SuppressWarnings("WeakerAccess") CompletionStage<TaxonomyGroup> getTaxonomyGroup(String taxonomyGroupCodename, List<NameValuePair> params); @SuppressWarnings("WeakerAccess") ContentLinkUrlResolver getContentLinkUrlResolver(); @SuppressWarnings("WeakerAccess") void setContentLinkUrlResolver(ContentLinkUrlResolver contentLinkUrlResolver); @SuppressWarnings("WeakerAccess") BrokenLinkUrlResolver getBrokenLinkUrlResolver(); @SuppressWarnings("WeakerAccess") void setBrokenLinkUrlResolver(BrokenLinkUrlResolver brokenLinkUrlResolver); @SuppressWarnings("WeakerAccess") RichTextElementResolver getRichTextElementResolver(); @SuppressWarnings("WeakerAccess") void setRichTextElementResolver(RichTextElementResolver richTextElementResolver); @SuppressWarnings("WeakerAccess") void addRichTextElementResolver(RichTextElementResolver richTextElementResolver); @SuppressWarnings("WeakerAccess") void registerType(String contentType, Class<?> clazz); @SuppressWarnings("WeakerAccess") void registerType(Class<?> clazz); @SuppressWarnings("WeakerAccess") void registerInlineContentItemsResolver(InlineContentItemsResolver resolver); @SuppressWarnings("WeakerAccess") void scanClasspathForMappings(String basePackage); @SuppressWarnings("WeakerAccess") void setCacheManager(AsyncCacheManager cacheManager); void setCacheManager(final CacheManager cacheManager);  }