Search in sources :

Example 1 with MethodsMetadata

use of org.springframework.data.type.MethodsMetadata in project spring-data-commons by spring-projects.

the class DefaultMethodsMetadataReaderUnitTests method shouldReadClassMethods.

// DATACMNS-1206
@Test
void shouldReadClassMethods() throws IOException {
    MethodsMetadata metadata = getMethodsMetadata(Foo.class);
    assertThat(metadata.getMethods()).hasSize(3);
    Iterator<MethodMetadata> iterator = metadata.getMethods().iterator();
    assertThat(iterator.next().getMethodName()).isEqualTo("one");
    assertThat(iterator.next().getMethodName()).isEqualTo("two");
    assertThat(iterator.next().getMethodName()).isEqualTo("three");
}
Also used : MethodsMetadata(org.springframework.data.type.MethodsMetadata) MethodMetadata(org.springframework.core.type.MethodMetadata) Test(org.junit.jupiter.api.Test)

Example 2 with MethodsMetadata

use of org.springframework.data.type.MethodsMetadata in project spring-data-commons by spring-projects.

the class DefaultMethodsMetadataReaderUnitTests method shouldReturnMethodMetadataByName.

// DATACMNS-1206
@Test
void shouldReturnMethodMetadataByName() throws IOException {
    MethodsMetadata metadata = getMethodsMetadata(Foo.class);
    assertThat(metadata.getMethods()).hasSize(3);
    assertThat(metadata.getMethods("one")).extracting(MethodMetadata::getMethodName).contains("one");
    assertThat(metadata.getMethods("foo")).isEmpty();
}
Also used : MethodsMetadata(org.springframework.data.type.MethodsMetadata) Test(org.junit.jupiter.api.Test)

Example 3 with MethodsMetadata

use of org.springframework.data.type.MethodsMetadata in project spring-data-commons by spring-projects.

the class DefaultMethodsMetadataReaderUnitTests method shouldReadInterfaceMethods.

// DATACMNS-1206
@Test
void shouldReadInterfaceMethods() throws IOException {
    MethodsMetadata metadata = getMethodsMetadata(Baz.class);
    assertThat(metadata.getMethods()).hasSize(3);
    Iterator<MethodMetadata> iterator = metadata.getMethods().iterator();
    assertThat(iterator.next().getMethodName()).isEqualTo("one");
    assertThat(iterator.next().getMethodName()).isEqualTo("two");
    assertThat(iterator.next().getMethodName()).isEqualTo("three");
}
Also used : MethodsMetadata(org.springframework.data.type.MethodsMetadata) MethodMetadata(org.springframework.core.type.MethodMetadata) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)3 MethodsMetadata (org.springframework.data.type.MethodsMetadata)3 MethodMetadata (org.springframework.core.type.MethodMetadata)2