Skip to content

Instantly share code, notes, and snippets.

@DaddyMoe
Last active December 18, 2017 10:03
Show Gist options
  • Save DaddyMoe/73583d47f82bb342a2beb0c23887993d to your computer and use it in GitHub Desktop.
Save DaddyMoe/73583d47f82bb342a2beb0c23887993d to your computer and use it in GitHub Desktop.
Test private constructor - For the days you want to be predantic
/**
* For the days you want to be predantic
*/
@Test
public void shouldHaveAPrivateConstructor() throws Exception {
Constructor constructor = EuroSemanticResponse.class.getDeclaredConstructor();
assertTrue("Constructor is not private", Modifier.isPrivate(constructor.getModifiers()));
constructor.setAccessible(true);
constructor.newInstance();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment