Create Test Class in IntelliJ

Scruffers :

I'm working within the traditional Maven Java project structure inside IntelliJ, e.g.

main/java/com/x/y
test/java/com/x/y

When I create a class called Foo in main/java/com/x/y using IntelliJ I would like to automatically have a file called FooTest.java created in test/java/com/x/y.

In Eclipse there is a button on the toolbar that will do much of the work involved in creating a skeleton test class, does anyone know of something similar in IntelliJ?

Thanks,

Jarl :

Use the menu selection Navigate -> Test, or Ctrl+Shift+T (Shift++T on Mac). This will go to the existing test class, or offer to generate it for you through a little wizard.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Create a Java class from a groovy test file in IntelliJ

Redefine template used to create a JUnit 5 class via "Create test" feature of IntelliJ 2019

Intellij Create Test missing JUnit

Class Not Found: Empty Test Suite in IntelliJ

Running Tomcat server Intellij Skip the test class

IntelliJ cannot run JUnit test class

How to create a test directory in Intellij 13?

Problem with IntelliJ -> Cannot create class with name "Main"

Auto create POJO class from database in IntelliJ

Can IntelliJ automatically create a decorator class?

Create a simple Java Class in IntelliJ 13

Intellij doesn't recognise Mockito class as Test class

Create reusable class for test data in rspec

Create gtest value parametrized test for a template class

Junit test in IntelliJ IDE can't see class for testing

IntelliJ test classpath: Different when running class vs package

Change default test class name suffix in Intellij IDEA

How to debug a JUnit test class for RESTful Web Services in IntelliJ IDEA?

Intellij Invokes AfterAllCallback Between Each Integration Test Class

Create a JUnit Test of a POJO class to test Object creation - Java

Using a constant class to create test descriptions for Testng test description

How do I create a new class in IntelliJ without using the mouse?

IntelliJ - Java Main Class is missing when I create a new project

Intellij IDEA plugin development. Action "create kotlin class"

Unable to create new Java class in new package on IntelliJ Idea?

How can I create a test object of a specific GUI class with the class determined at test runtime?

how to create test class and folder from android studio?

How to create a sort of abstract super test class in JUnit 4?

How do I create an equality test for a custom class in Swift?