Моя проблема в том, что если я 3 раза имитирую jdbcTemplate.queryForObject (), то работает только первый макет, а 2 других макета возвращаются с нулем. Что не так с этим кодом? Любая помощь приветствуется. Спасибо.
//this works correctly and returns 1
Mockito.when(jdbcTemplate.queryForObject(eq("select count(*) from TEST_TABLE_1"), (MapSqlParameterSource) any(), eq(Integer.class))).thenReturn(1);
//this returns null
Mockito.when(jdbcTemplate.queryForObject(eq("select count(*) from TEST_TABLE_11"),(MapSqlParameterSource) any(), eq(Integer.class))).thenReturn(2);
//this returns null as well
Mockito.when(jdbcTemplate.queryForObject(eq("select count(*) from TEST_TABLE_111"), (MapSqlParameterSource) any(), eq(Integer.class))).thenReturn(3);
'''