### Question:
AnnotationBapiMapper { public BapiMapping mapBapi(final Class<?> clazz) { assertIsBapiClass(clazz); Bapi bapiAnnotation = clazz.getAnnotation(BAPI); BapiMapping bapiMapping = new BapiMapping(clazz, bapiAnnotation.value(), getErrorHandling(clazz)); Set<Field> fields = getDeclaredFieldsWithAnnotationRecursively(clazz, PARAMETER); for (Field field : fields) { addParameterToBapiMapping(bapiMapping, new BapiField(field)); } return bapiMapping; }  BapiMapping mapBapi(final Class<?> clazz);  }### Answer:
@Test public void mapsBapiStructureWithInheritedField() { final BapiMapping mapping = mapper.mapBapi(TestBapiClass.class); final TableMapping tableMapping = mapping.getTableParameters().iterator().next(); final Set<ParameterMapping> parameters = tableMapping.getComponentParameter().getParameters(); assertThat(parameters).hasSize(2) .extracting(ParameterMapping::getJavaName).containsOnly("structureParamSubClass", "structureParamSuperClass"); }
@Test public void mapsTable() { final BapiMapping mapping = mapper.mapBapi(TestBapiClass.class); final Set<TableMapping> tableParams = mapping.getTableParameters(); assertThat(tableParams).hasSize(1); final TableMapping tableMapping = tableParams.iterator().next(); assertThat(tableMapping.getAssociatedType().getName()).isEqualTo(TestBapiStructureSubClass.class.getName()); }
@Test public void mapsChangingParameter() { final BapiMapping mapping = mapper.mapBapi(TestBapiClass.class); Set<ParameterMapping> changingParameters = mapping.getChangingParameters(); assertThat(changingParameters).extracting("associatedType").containsOnly(String.class); assertThat(changingParameters).extracting("javaName").containsOnly("changingParam"); assertThat(changingParameters).extracting("sapName").containsOnly("CHANGING_PARAM"); }