Created
April 19, 2020 10:58
-
-
Save thetekst/48b090ce69b990f61c3a1264b68c202b to your computer and use it in GitHub Desktop.
Spring Boot Test. Spock. Check for ApplicationContext
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.tkachenko.app; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
/** | |
* @author d.tkachenko | |
*/ | |
@SpringBootApplication | |
public class Application { | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.tkachenko.app | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.boot.test.context.SpringBootTest | |
import spock.lang.Specification | |
/** | |
* @author d.tkachenko | |
*/ | |
@SpringBootTest | |
class ApplicationTest extends Specification { | |
@Autowired(required = false) | |
private Application application | |
def test() { | |
expect: "the Application is created" | |
application | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment