Last active
December 12, 2023 13:50
-
-
Save turing85/004f6d96e4a68af4007c326e1d8cb3e0 to your computer and use it in GitHub Desktop.
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 com.example.demo; | |
import org.junit.jupiter.api.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; | |
import org.springframework.orm.jpa.AbstractEntityManagerFactoryBean; | |
import static org.mockito.Mockito.doNothing; | |
import static org.mockito.Mockito.spy; | |
@SpringBootTest | |
class MyIntegrationTests { | |
@Autowired | |
private AbstractEntityManagerFactoryBean entityManagerFactoryBean; | |
@Test | |
void myIntegrationTest() { | |
AbstractEntityManagerFactoryBean emfSpy = spy(entityManagerFactoryBean); | |
doNothing().when(emfSpy).destroy(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment