Skip to content

Instantly share code, notes, and snippets.

@dehidehidehi
Created August 2, 2022 16:39
Show Gist options
  • Save dehidehidehi/cf6955a2febeb81236abc1a0e33df90e to your computer and use it in GitHub Desktop.
Save dehidehidehi/cf6955a2febeb81236abc1a0e33df90e to your computer and use it in GitHub Desktop.
@IntegrationTEST - Short hand annotation for Spring for basic usage
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.DirtiesContext;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Base composite annotation for integration tests.
* JHipster reference:
* <a href="https://github.com/jhipster/generator-jhipster/blob/main/generators/server/templates/src/test/java/package/IntegrationTest.java.ejs">https://github.com/jhipster/generator-jhipster/blob/main/generators/server/templates/src/test/java/package/IntegrationTest.java.ejs</a>
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@SpringBootTest(classes = {CurrentMainApp.class})
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
public @interface IntegrationTest {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment