@Test public void getApiRolesTest(){ List<Map<String, Object>>apiroles=new ArrayList<>(); Map<String,Object>roleDetails =new HashMap<>(); roleDetails.put("roles", "admin"); roleDetails.put("urls", "/test"); apiroles.add(roleDetails); when(jdbcTemplate.queryForList(anyString())).thenReturn(apiroles); notificationImpl.getApiRoles("test", "dev"); }
@Override public List<Map<String, Object>> getApiRoles(String serviceProject, String environment) { String query = "SELECT roles, urls FROM ApiRbac WHERE serviceProject='"+ serviceProject +"' AND environment='"+ environment +"'"; return jdbcTemplate.queryForList(query); }
NotificationServiceImpl implements NotificationService,Constants { @Override public List<Map<String, Object>> getApiRoles(String serviceProject, String environment) { String query = "SELECT roles, urls FROM ApiRbac WHERE serviceProject='"+ serviceProject +"' AND environment='"+ environment +"'"; return jdbcTemplate.queryForList(query); } }
NotificationServiceImpl implements NotificationService,Constants { @Override public List<Map<String, Object>> getApiRoles(String serviceProject, String environment) { String query = "SELECT roles, urls FROM ApiRbac WHERE serviceProject='"+ serviceProject +"' AND environment='"+ environment +"'"; return jdbcTemplate.queryForList(query); }  }
NotificationServiceImpl implements NotificationService,Constants { @Override public List<Map<String, Object>> getApiRoles(String serviceProject, String environment) { String query = "SELECT roles, urls FROM ApiRbac WHERE serviceProject='"+ serviceProject +"' AND environment='"+ environment +"'"; return jdbcTemplate.queryForList(query); }  @Override List<Map<String, Object>> getApiRoles(String serviceProject, String environment); Map<String,Object> getDeviceDetails(String deviceId); @Override List<Map<String,Object>> getAllAssetGroupOwnerEmailDetails(); @Override Map<String, Object> unsubscribeDigestMail(final String mailId); @Override Map<String, Object> subscribeDigestMail(String mailId); }
NotificationServiceImpl implements NotificationService,Constants { @Override public List<Map<String, Object>> getApiRoles(String serviceProject, String environment) { String query = "SELECT roles, urls FROM ApiRbac WHERE serviceProject='"+ serviceProject +"' AND environment='"+ environment +"'"; return jdbcTemplate.queryForList(query); }  @Override List<Map<String, Object>> getApiRoles(String serviceProject, String environment); Map<String,Object> getDeviceDetails(String deviceId); @Override List<Map<String,Object>> getAllAssetGroupOwnerEmailDetails(); @Override Map<String, Object> unsubscribeDigestMail(final String mailId); @Override Map<String, Object> subscribeDigestMail(String mailId);  }