You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a DataTable that I am trying to convert into List<Target>. I've written a suitable TargetConverter for Target, but have discovered that Cucumber won't invoke my Converter unless I also annotate Target with @XStreamConverter. Unfortunately, the Target class is not mine to annotate. Subclassing Targetdoes work, but is fugly.
Is there any other way to associate my Target class with TargetConverter please? If not, perhaps Cucumber could provide a mechanism to do so, e.g. some kind of top-level annotation on the step definition class?
@CustomerConverters({
@CustomerConverter(value = TargetConverter.class, type = Target.class, priority = 1),
...
})
public class MySteps {
@Given("^we have stuff like:")
public void setStuff(List<Target> stuff) {
...;
}
}
Or maybe even:
@XStreamConverters(
@XStreamConverter(TargetConverter.class)
)
@RunWith(Cucumber.class)
public class RunCukesTest {
}
which would probably be clearer. The converters could then be registered with the LocalizedXStreams object up front by passing them to Runtime via RuntimeOptions. Does this sound reasonable, please?
The text was updated successfully, but these errors were encountered:
Hi,
I have a
DataTable
that I am trying to convert intoList<Target>
. I've written a suitableTargetConverter
forTarget
, but have discovered that Cucumber won't invoke myConverter
unless I also annotateTarget
with@XStreamConverter
. Unfortunately, theTarget
class is not mine to annotate. SubclassingTarget
does work, but is fugly.Is there any other way to associate my
Target
class withTargetConverter
please? If not, perhaps Cucumber could provide a mechanism to do so, e.g. some kind of top-level annotation on the step definition class?Or maybe even:
which would probably be clearer. The converters could then be registered with the
LocalizedXStreams
object up front by passing them toRuntime
viaRuntimeOptions
. Does this sound reasonable, please?The text was updated successfully, but these errors were encountered: