ApplicationScope extends AbstractAuthzEntity { @Override @Transient @JsonIgnore public User getOwner() { if (application != null) { return application.getOwner(); } return null; }  Application getApplication(); void setApplication(final Application application); List<Role> getRoles(); void setRoles(final List<Role> roles); List<OAuthToken> getTokens(); void setTokens(final List<OAuthToken> tokens); String getName(); void setName(final String name); @Override @Transient @JsonIgnore User getOwner();  }
@Test public void testGetOwner() { ApplicationScope scope = new ApplicationScope(); Application spy = spy(new Application()); assertNull(scope.getOwner()); scope.setApplication(spy); scope.getOwner(); Mockito.verify(spy).getOwner(); }