Tabnine Logo
LinkDescriptor.attributes
Code IndexAdd Tabnine to your IDE (free)

How to use
attributes
method
in
org.springframework.restdocs.hypermedia.LinkDescriptor

Best Java code snippets using org.springframework.restdocs.hypermedia.LinkDescriptor.attributes (Showing top 1 results out of 315)

origin: spring-projects/spring-restdocs

@Test
public void linksWithCustomDescriptorAttributes() throws IOException {
  TemplateResourceResolver resolver = mock(TemplateResourceResolver.class);
  given(resolver.resolveTemplateResource("links"))
      .willReturn(snippetResource("links-with-extra-column"));
  new LinksSnippet(
      new StubLinkExtractor().withLinks(new Link("a", "alpha"),
          new Link("b", "bravo")),
      Arrays.asList(
          new LinkDescriptor("a").description("one")
              .attributes(key("foo").value("alpha")),
          new LinkDescriptor("b").description("two")
              .attributes(key("foo").value("bravo"))))
                  .document(this.operationBuilder.attribute(
                      TemplateEngine.class.getName(),
                      new MustacheTemplateEngine(resolver))
                      .build());
  assertThat(this.generatedSnippets.links())
      .is(tableWithHeader("Relation", "Description", "Foo")
          .row("a", "one", "alpha").row("b", "two", "bravo"));
}
org.springframework.restdocs.hypermediaLinkDescriptorattributes

Popular methods of LinkDescriptor

  • description
  • ignored
  • optional
    Marks the link as optional.
  • <init>
    Creates a new LinkDescriptor describing a link with the given rel.
  • getAttributes
  • getDescription
  • getRel
    Returns the rel of the link described by this descriptor.
  • isIgnored
  • isOptional
    Returns true if the described link is optional, otherwise false.

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • getSystemService (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Collectors (java.util.stream)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now