@Test
    @DirtiesContext
    void testAdviceIsPresentWithExceptionMapping() {
        log.info("--- Starting tests with advice auto discovery ---");

        Map<String, Object> expectedAdviceBeans = new HashMap<>();
        expectedAdviceBeans.put("grpcAdviceWithBean", testAdviceWithOutMetadata);
        expectedAdviceBeans.put(TestAdviceWithMetadata.class.getName(), testAdviceWithMetadata);
        expectedAdviceBeans.put(TestAdviceForInheritedExceptions.class.getName(), testAdviceForInheritedExceptions);
        Set<Method> expectedAdviceMethods = expectedMethods();

        Map<String, Object> actualAdviceBeans = grpcAdviceDiscoverer.getAnnotatedBeans();
        Set<Method> actualAdviceMethods = grpcAdviceDiscoverer.getAnnotatedMethods();

        assertThat(actualAdviceBeans)
                .hasSize(ADVICE_CLASSES)
                .containsExactlyInAnyOrderEntriesOf(expectedAdviceBeans);
        assertThat(actualAdviceMethods)
                .hasSize(ADVICE_METHODS)
                .containsExactlyInAnyOrderElementsOf(expectedAdviceMethods);
    }
A test to verify that the grpc exception advice auto configuration works.

@author Andjelko Perisic (andjelko.perisic@gmail.com)
tests/src/test/java/net/devh/boot/grpc/test/advice/AdviceIsPresentAutoConfigurationTest.java