@Test
public void getUsersSubjectsTest() throws Exception {

	System.out.println("getUsersSubjectsTest");
	// define needed attributes
	String usersQuery = "usersQuery";
	Map<String, String> mapOfAttributes = new HashMap<>();
	mapOfAttributes.put("usersQuery", usersQuery);
	mapOfAttributes.put("url", "some.url.com");
	doReturn(mapOfAttributes).when(extSourceREMS).getAttributes();
	// mock data got from database
	doNothing().when(extSourceREMS).createConnection();
	PreparedStatement preparedStatement = mock(PreparedStatement.class);
	doReturn(preparedStatement).when(extSourceREMS).getPreparedStatement(usersQuery, null, 0);
	ResultSet resultSet = mock(ResultSet.class, RETURNS_DEEP_STUBS);
	doReturn(resultSet).when(preparedStatement).executeQuery();
	doReturn(true, false).when(resultSet).next();
	doReturn("josef").when(resultSet).getString("firstName");
	doReturn("xjosef").when(resultSet).getString("login");
	User user = new User();
	user.setFirstName("josef");
	when(perunBl.getUsersManagerBl().getUsersByExtSourceTypeAndLogin(any(), anyString(), eq("xjosef"))).thenReturn(Collections.singletonList(user));
	// create expected subject to get
	List<Map<String, String>> expectedSubjects = new ArrayList<>();
	Map<String, String> subject = new HashMap<>();
	subject.put("firstName", "josef");
	subject.put("login", "xjosef");
	subject.put("lastName", null);
	subject.put("titleBefore", null);
	subject.put("titleAfter", null);
	subject.put("middleName", null);
	expectedSubjects.add(subject);
	// test the method
	List<Map<String, String>> actualSubjects = extSourceREMS.getUsersSubjects();
	assertEquals("subjects should be same", expectedSubjects, actualSubjects);
}