@Test
public void testGetAccount() throws Exception {

    // Create the request and response for the Shiro login
    HttpServletRequest request = mock(HttpServletRequest.class);
    HttpSession session = mock(HttpSession.class);
    when(request.getSession()).thenReturn(session);
    HttpServletResponse response = mock(HttpServletResponse.class);
    // Create the object to be tested
    AccountResource resource = new AccountResource();
    // Log the user in to shiro
    loginUser(request, response, "jad", "1ad");
    // Create mock OSGi services to inject and inject it
    MockLogService logservice = new MockLogService();
    resource.logservice = logservice;
    // Inject fake OSGi service UkelonnService
    UkelonnService ukelonn = mock(UkelonnService.class);
    when(ukelonn.getAccount(anyString())).thenReturn(getJadAccount());
    resource.ukelonn = ukelonn;
    // Run the method under test
    Account result = resource.getAccount("jad");
    // Check the result
    assertEquals("jad", result.getUsername());
    assertEquals(673.0, result.getBalance(), 0.0);
}