Authenticator extends AbstractAuthzEntity { @Override @Transient @JsonIgnore public User getOwner() { if (client != null) { return client.getOwner(); } return null; }  Client getClient(); void setClient(final Client client); AuthenticatorType getType(); void setType(final AuthenticatorType type); Map<String, String> getConfiguration(); void setConfiguration(final Map<String, String> configuration); List<AuthenticatorState> getStates(); void setStates(final List<AuthenticatorState> states); @Override @Transient @JsonIgnore User getOwner();  }
@Test public void testGetOwner() { Authenticator authenticator = new Authenticator(); Client spy = spy(new Client()); assertNull(authenticator.getOwner()); authenticator.setClient(spy); authenticator.getOwner(); Mockito.verify(spy).getOwner(); }