@Ignore @Test public void postNotice() { NotificationStrategy ns = new MicroblogNotificationStrategy(m_daoConfigResource); List<Argument> arguments = configureArgs(); Assert.assertEquals("NotificationStrategy should return 0 on success", 0, ns.send(arguments)); }
public int send(List<Argument> arguments) { Twitter svc = buildUblogService(arguments); String messageBody = buildMessageBody(arguments); Status response; if (log().isDebugEnabled()) { log().debug("Dispatching microblog notification for user '" + svc.getUserId() + "' at base URL '" + svc.getBaseURL() + "' with message '" + messageBody + "'"); } try { response = svc.updateStatus(messageBody); } catch (TwitterException e) { log().error("Microblog notification failed"); log().info("Failed to update status for user '" + svc.getUserId() + "' at service URL '" + svc.getBaseURL() + "', caught exception: " + e.getMessage()); return 1; } log().info("Microblog notification succeeded: update posted with ID " + response.getId()); return 0; }
MicroblogNotificationStrategy implements NotificationStrategy { public int send(List<Argument> arguments) { Twitter svc = buildUblogService(arguments); String messageBody = buildMessageBody(arguments); Status response; if (log().isDebugEnabled()) { log().debug("Dispatching microblog notification for user '" + svc.getUserId() + "' at base URL '" + svc.getBaseURL() + "' with message '" + messageBody + "'"); } try { response = svc.updateStatus(messageBody); } catch (TwitterException e) { log().error("Microblog notification failed"); log().info("Failed to update status for user '" + svc.getUserId() + "' at service URL '" + svc.getBaseURL() + "', caught exception: " + e.getMessage()); return 1; } log().info("Microblog notification succeeded: update posted with ID " + response.getId()); return 0; } }
MicroblogNotificationStrategy implements NotificationStrategy { public int send(List<Argument> arguments) { Twitter svc = buildUblogService(arguments); String messageBody = buildMessageBody(arguments); Status response; if (log().isDebugEnabled()) { log().debug("Dispatching microblog notification for user '" + svc.getUserId() + "' at base URL '" + svc.getBaseURL() + "' with message '" + messageBody + "'"); } try { response = svc.updateStatus(messageBody); } catch (TwitterException e) { log().error("Microblog notification failed"); log().info("Failed to update status for user '" + svc.getUserId() + "' at service URL '" + svc.getBaseURL() + "', caught exception: " + e.getMessage()); return 1; } log().info("Microblog notification succeeded: update posted with ID " + response.getId()); return 0; } MicroblogNotificationStrategy();  MicroblogNotificationStrategy(Resource configResource); }
MicroblogNotificationStrategy implements NotificationStrategy { public int send(List<Argument> arguments) { Twitter svc = buildUblogService(arguments); String messageBody = buildMessageBody(arguments); Status response; if (log().isDebugEnabled()) { log().debug("Dispatching microblog notification for user '" + svc.getUserId() + "' at base URL '" + svc.getBaseURL() + "' with message '" + messageBody + "'"); } try { response = svc.updateStatus(messageBody); } catch (TwitterException e) { log().error("Microblog notification failed"); log().info("Failed to update status for user '" + svc.getUserId() + "' at service URL '" + svc.getBaseURL() + "', caught exception: " + e.getMessage()); return 1; } log().info("Microblog notification succeeded: update posted with ID " + response.getId()); return 0; } MicroblogNotificationStrategy();  MicroblogNotificationStrategy(Resource configResource); int send(List<Argument> arguments); void setMicroblogConfigurationDao(MicroblogConfigurationDao dao); MicroblogConfigurationDao getMicroblogConfigurationDao(); }
MicroblogNotificationStrategy implements NotificationStrategy { public int send(List<Argument> arguments) { Twitter svc = buildUblogService(arguments); String messageBody = buildMessageBody(arguments); Status response; if (log().isDebugEnabled()) { log().debug("Dispatching microblog notification for user '" + svc.getUserId() + "' at base URL '" + svc.getBaseURL() + "' with message '" + messageBody + "'"); } try { response = svc.updateStatus(messageBody); } catch (TwitterException e) { log().error("Microblog notification failed"); log().info("Failed to update status for user '" + svc.getUserId() + "' at service URL '" + svc.getBaseURL() + "', caught exception: " + e.getMessage()); return 1; } log().info("Microblog notification succeeded: update posted with ID " + response.getId()); return 0; } MicroblogNotificationStrategy();  MicroblogNotificationStrategy(Resource configResource); int send(List<Argument> arguments); void setMicroblogConfigurationDao(MicroblogConfigurationDao dao); MicroblogConfigurationDao getMicroblogConfigurationDao();  }