@Test public void getAllAssetGroupOwnerEmailDetailsTest(){ List<Map<String,Object>> agOwnerDetails=new ArrayList<>(); Map<String,Object>ownerDetails=new HashMap<>(); ownerDetails.put("ownerName", "Matt"); ownerDetails.put("assetGroup", "ag1"); ownerDetails.put("ownerEmail", "Matt@testmail.com"); agOwnerDetails.add(ownerDetails); when(jdbcTemplate.queryForList(anyString())).thenReturn(agOwnerDetails); notificationImpl.getAllAssetGroupOwnerEmailDetails(); }
@Override public List<Map<String,Object>> getAllAssetGroupOwnerEmailDetails() { String query = "SELECT displayName AS ownerName, groupName AS assetGroup, ownerEmailId AS ownerEmail FROM cf_AssetGroupDetails LEFT JOIN cf_AssetGroupOwnerDetails ON (groupName = assetGroupName) WHERE groupType = 'Director' AND ownerEmailId NOT IN (SELECT emailId FROM PacmanSubscriptions WHERE subscriptionValue=0) GROUP BY groupName"; return jdbcTemplate.queryForList(query); }
NotificationServiceImpl implements NotificationService,Constants { @Override public List<Map<String,Object>> getAllAssetGroupOwnerEmailDetails() { String query = "SELECT displayName AS ownerName, groupName AS assetGroup, ownerEmailId AS ownerEmail FROM cf_AssetGroupDetails LEFT JOIN cf_AssetGroupOwnerDetails ON (groupName = assetGroupName) WHERE groupType = 'Director' AND ownerEmailId NOT IN (SELECT emailId FROM PacmanSubscriptions WHERE subscriptionValue=0) GROUP BY groupName"; return jdbcTemplate.queryForList(query); } }
NotificationServiceImpl implements NotificationService,Constants { @Override public List<Map<String,Object>> getAllAssetGroupOwnerEmailDetails() { String query = "SELECT displayName AS ownerName, groupName AS assetGroup, ownerEmailId AS ownerEmail FROM cf_AssetGroupDetails LEFT JOIN cf_AssetGroupOwnerDetails ON (groupName = assetGroupName) WHERE groupType = 'Director' AND ownerEmailId NOT IN (SELECT emailId FROM PacmanSubscriptions WHERE subscriptionValue=0) GROUP BY groupName"; return jdbcTemplate.queryForList(query); }  }
NotificationServiceImpl implements NotificationService,Constants { @Override public List<Map<String,Object>> getAllAssetGroupOwnerEmailDetails() { String query = "SELECT displayName AS ownerName, groupName AS assetGroup, ownerEmailId AS ownerEmail FROM cf_AssetGroupDetails LEFT JOIN cf_AssetGroupOwnerDetails ON (groupName = assetGroupName) WHERE groupType = 'Director' AND ownerEmailId NOT IN (SELECT emailId FROM PacmanSubscriptions WHERE subscriptionValue=0) GROUP BY groupName"; 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>> getAllAssetGroupOwnerEmailDetails() { String query = "SELECT displayName AS ownerName, groupName AS assetGroup, ownerEmailId AS ownerEmail FROM cf_AssetGroupDetails LEFT JOIN cf_AssetGroupOwnerDetails ON (groupName = assetGroupName) WHERE groupType = 'Director' AND ownerEmailId NOT IN (SELECT emailId FROM PacmanSubscriptions WHERE subscriptionValue=0) GROUP BY groupName"; 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);  }