Skip to content

Commit a195c2d

Browse files
committed
test: create a class to provide valid data
Signed-off-by: Maximillian Arruda <[email protected]>
1 parent e0b6eb3 commit a195c2d

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright 2023 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
package br.org.soujava.pomeditor;
19+
20+
import org.junit.jupiter.api.extension.ExtensionContext;
21+
import org.junit.jupiter.params.provider.Arguments;
22+
import org.junit.jupiter.params.provider.ArgumentsProvider;
23+
24+
import java.util.UUID;
25+
import java.util.stream.Stream;
26+
27+
import static org.junit.jupiter.params.provider.Arguments.arguments;
28+
29+
public class ValidDependenciesArgs implements ArgumentsProvider {
30+
31+
@Override
32+
public Stream<? extends Arguments> provideArguments(ExtensionContext extensionContext) {
33+
return Stream.of(
34+
arguments(
35+
UUID.randomUUID().toString(), // groupId
36+
UUID.randomUUID().toString(), // artifactId
37+
UUID.randomUUID().toString(), // version
38+
null // artifactId,
39+
),
40+
arguments(
41+
null, // groupId,
42+
"artifactId" // artifactId,
43+
),
44+
arguments(
45+
"groupId", // groupId,
46+
null // artifactId,
47+
),
48+
arguments(
49+
"", // groupId,
50+
"" // artifactId,
51+
),
52+
arguments(
53+
"", // groupId,
54+
"artifactId" // artifactId,
55+
),
56+
arguments(
57+
"groupId", // groupId,
58+
"" // artifactId,
59+
)
60+
);
61+
}
62+
}

0 commit comments

Comments
 (0)