Skip to content

Commit

Permalink
Supply invocation index for @ParameterizedTest to test author : using…
Browse files Browse the repository at this point in the history
… int instead of Integer
  • Loading branch information
jminkhar committed Nov 11, 2022
1 parent 219abcc commit e232d6c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private ExtensionContext.Store getStore(ExtensionContext context) {
}

private TestTemplateInvocationContext createInvocationContext(ParameterizedTestNameFormatter formatter,
ParameterizedTestMethodContext methodContext, Object[] arguments, Integer invocationIndex) {
ParameterizedTestMethodContext methodContext, Object[] arguments, int invocationIndex) {
return new ParameterizedTestInvocationContext(formatter, methodContext, arguments, invocationIndex);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class ParameterizedTestInvocationContext implements TestTemplateInvocationContex
private final ParameterizedTestNameFormatter formatter;
private final ParameterizedTestMethodContext methodContext;
private final Object[] arguments;
private final Integer invocationIndex;
private final int invocationIndex;

ParameterizedTestInvocationContext(ParameterizedTestNameFormatter formatter,
ParameterizedTestMethodContext methodContext, Object[] arguments, Integer invocationIndex) {
ParameterizedTestMethodContext methodContext, Object[] arguments, int invocationIndex) {
this.formatter = formatter;
this.methodContext = methodContext;
this.arguments = arguments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ int indexOfFirstAggregator() {
* Resolve the parameter for the supplied context using the supplied
* arguments.
*/
Object resolve(ParameterContext parameterContext, Object[] arguments, Integer invocationIndex) {
Object resolve(ParameterContext parameterContext, Object[] arguments, int invocationIndex) {
return getResolver(parameterContext).resolve(parameterContext, arguments, invocationIndex);
}

Expand Down Expand Up @@ -213,7 +213,7 @@ Resolver createResolver(ParameterContext parameterContext) {
}

interface Resolver {
Object resolve(ParameterContext parameterContext, Object[] arguments, Integer invocationIndex);
Object resolve(ParameterContext parameterContext, Object[] arguments, int invocationIndex);
}

static class Converter implements Resolver {
Expand All @@ -227,7 +227,7 @@ static class Converter implements Resolver {
}

@Override
public Object resolve(ParameterContext parameterContext, Object[] arguments, Integer invocationIndex) {
public Object resolve(ParameterContext parameterContext, Object[] arguments, int invocationIndex) {
Object argument = arguments[parameterContext.getIndex()];
try {
return this.argumentConverter.convert(argument, parameterContext);
Expand All @@ -250,7 +250,7 @@ static class Aggregator implements Resolver {
}

@Override
public Object resolve(ParameterContext parameterContext, Object[] arguments, Integer invocationIndex) {
public Object resolve(ParameterContext parameterContext, Object[] arguments, int invocationIndex) {
ArgumentsAccessor accessor = new DefaultArgumentsAccessor(invocationIndex, arguments);
try {
return this.argumentsAggregator.aggregateArguments(accessor, parameterContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class ParameterizedTestParameterResolver implements ParameterResolver, AfterTest

private final ParameterizedTestMethodContext methodContext;
private final Object[] arguments;
private final Integer invocationIndex;
private final int invocationIndex;

ParameterizedTestParameterResolver(ParameterizedTestMethodContext methodContext, Object[] arguments,
Integer invocationIndex) {
int invocationIndex) {
this.methodContext = methodContext;
this.arguments = arguments;
this.invocationIndex = invocationIndex;
Expand Down

0 comments on commit e232d6c

Please sign in to comment.