SecurityContextUtil implements UserUtil { @Override public String getCurrentUsername() throws NoUserLoggedInException { DuracloudUserDetails userDetails = getCurrentUserDetails(); return userDetails.getUsername(); }  @Override String getCurrentUsername(); Credential getCurrentUser(); DuracloudUserDetails getCurrentUserDetails();  }
@Test public void testGetCurrentUsername() throws Exception { createCurrentUserMock(); String user = util.getCurrentUsername(); Assert.assertNotNull(user); Assert.assertEquals(username, user); }