Created
June 6, 2019 18:23
-
-
Save yusufcakal/7b528542346411933bfb0cb9140b2978 to your computer and use it in GitHub Desktop.
Util class for controller integration test in spring boot
This file contains hidden or 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
@RunWith(SpringRunner.class) | |
@SpringBootTest | |
@AutoConfigureMockMvc | |
@ActiveProfiles("test") | |
public abstract class BaseControllerIntegrationTest { | |
@PersistenceContext | |
protected EntityManager entityManager; | |
@Autowired | |
protected MockMvc mockMvc; | |
@Autowired | |
protected Gson gson; | |
protected String toJson(Object object) { | |
return gson.toJson(object); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment