@Test
void bean() {

    config.bean(TestBean.class);
    assertThat(config.context.serviceRegistry.beanClasses).contains(TestBean.class);
    config.bean(TestQueryParamBean.class);
    assertThat(config.context.serviceRegistry.beanClasses).contains(TestQueryParamBean.class);
    config.bean(TestEnum.class);
    assertThat(config.context.serviceRegistry.beanClasses).contains(TestEnum.class);
    assertThatThrownBy(() -> config.bean(TestBean.class))
            .isInstanceOf(Error.class)
            .hasMessageContaining("bean class is already registered");
    assertThatThrownBy(() -> config.bean(TestQueryParamBean.class))
            .isInstanceOf(Error.class)
            .hasMessageContaining("bean class is already registered");
    assertThatThrownBy(() -> config.bean(TestEnum.class))
            .isInstanceOf(Error.class)
            .hasMessageContaining("bean class is already registered");
}