Rafactored the getIdentity and more asserts on unit tests.