我正在尝试使用编写MapStruct映射器的单元测试componentModel="spring"。
该应用程序完美运行,包括mapper注入。问题是映射器没有注入到测试类中,并且出现以下错误:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.onap.sdc.workflow.api.mapping.WorkflowMapperTest': Unsatisfied dependency expressed through field 'workflowMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.onap.sdc.workflow.services.mappers.WorkflowMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Run Code Online (Sandbox Code Playgroud)
我正在使用intellij IDEA并标记了target \ generation-sources。
这是映射器类:
@Mapper(componentModel = "spring")
public interface WorkflowMapper {
@Mapping(source = "properties", target = "category", qualifiedByName = "propertiesToCategoryMapper")
Workflow itemToWorkflow(Item item);
@Mapping(source = "category", target = "properties", qualifiedByName = "categoryToPropertiesMapper")
@InheritInverseConfiguration
Item workflowToItem(Workflow workflow);
@Named("propertiesToCategoryMapper")
default …Run Code Online (Sandbox Code Playgroud) 我有以下html:
input id="abc_0_1"
input id="rub_0_1"
input id="rub_0_2"
input id="rub_1_1"
input id="rub_1_2"
input id="rub_2_1"
input id="rub_2_1"
input id="abc_4_5"
Run Code Online (Sandbox Code Playgroud)
使用jQuery我想只选择以'rub_'开头但不以'rub_0'开头的输入
我怎么能这样做,假设我有更多类似ID的输入?
谢谢,
阿维