-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
ObjectArrayArguments.java
51 lines (42 loc) · 1.44 KB
/
ObjectArrayArguments.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* Copyright 2015-2017 the original author or authors.
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
* accompanies this distribution and is available at
*
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.junit.jupiter.params.provider;
import static org.junit.platform.commons.meta.API.Usage.Experimental;
import org.junit.platform.commons.meta.API;
/**
* Concrete implementation of the {@code Arguments} API that provides access to
* an array of objects to be used for invoking a {@code @ParameterizedTest} method.
*
* <p>A {@link java.util.stream.Stream} of such {@code Arguments} will
* typically be accessed via {@linkplain ArgumentsProvider providers}.
*
* @since 5.0
* @see org.junit.jupiter.params.ParameterizedTest
* @see org.junit.jupiter.params.provider.ArgumentsSource
* @see org.junit.jupiter.params.provider.ArgumentsProvider
*/
@API(Experimental)
public class ObjectArrayArguments implements Arguments {
private final Object[] arguments;
/**
* Factory method for creating an {@code ObjectArrayArguments} based on the
* supplied arguments
*/
public static ObjectArrayArguments arguments(Object... arguments) {
return new ObjectArrayArguments(arguments);
}
private ObjectArrayArguments(Object... arguments) {
this.arguments = arguments;
}
@Override
public Object[] get() {
return this.arguments;
}
}