TLE-23 Junit Tests

Refactored test and fixed a null pointer exception