Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from JUnit 4 to JUnit 5 #1652

Merged
merged 6 commits into from Aug 16, 2019

Conversation

kunal-kushwaha
Copy link
Contributor

Fixes #1331

@centos-ci
Copy link

Can one of the admins verify this patch?

@rohanKanojia
Copy link
Member

ok to test

@rohanKanojia
Copy link
Member

@kunal-kushwaha : Could you please resolve conflicts here also?

@rohanKanojia rohanKanojia added the gsoc candidate for GSoC label Jul 26, 2019
@rohanKanojia
Copy link
Member

@ricardozanini : I see that you wanted to contribute to this issue. Would really appreciate if you could help to review this PR ;-) . This PR is sent by a Google summer of code student so would really appreciate if you contribute here(if you have time of course ;-) )

Copy link
Member

@rohanKanojia rohanKanojia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good. I have only some minor questions regarding itests

</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-migrationsupport</artifactId>
<version>${junit.version}</version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean junit.version here or junit.platform.version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohanKanojia: I changed <junit.version> to 5.5.1 used in vintage and jupiter.

</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-migrationsupport</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, did you really mean to use junit.version here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rohanKanojia: Yes, it's the latest version 5.5.1 for org.junit.jupiter.

kubernetes-itests/pom.xml Show resolved Hide resolved
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Why we need to use the vintage engine? We still depends on projects that run on JUnit 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I put it just for testing but it's not required. Fixed.

<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say to have one single property specification junit.version or junit.platform.version.

public void testIllegalNodeName() throws JsonProcessingException {
new io.fabric8.kubernetes.api.model.NodeBuilder().withNewMetadata().withName("..").and().build();
Assertions.assertThrows(ConstraintViolationException.class, new Executable() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a question, since I had the same problem and solved by calling the method directly. Why we can't just call new io.fabric8.kubernetes.api.model.NodeBuilder().withNewMetadata().withName("..").and().build(); directly in the Assertions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the source version in the model was set to 1.7 which does not allow Lambda Expressions. Fixed.

<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we have this version on a properties section inside a BOM?

</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

pom.xml Show resolved Hide resolved
@rohanKanojia
Copy link
Member

@kunal-kushwaha : Could you please rebase your branch with latest master? I think we are good to merge this.

CHANGELOG.md Outdated Show resolved Hide resolved
@kunal-kushwaha
Copy link
Contributor Author

@rohanKanojia: fixed conflicts

@rohanKanojia
Copy link
Member

[merge]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc candidate for GSoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate from JUnit 4 to JUnit 5 for the kubernetes-server-mocks
6 participants