@Test public void testQueueTemplate() { assertTrue(SQSQueueFactoryImpl.isValidSQSTemplate("{{id}}{{entity}}{{port}}")); assertTrue(SQSQueueFactoryImpl.isValidSQSTemplate(new ProxyConfig().getSqsQueueNameTemplate())); assertFalse(SQSQueueFactoryImpl.isValidSQSTemplate("{{id}{{entity}}{{port}}")); assertFalse(SQSQueueFactoryImpl.isValidSQSTemplate("{{id}}{entity}}{{port}}")); assertFalse(SQSQueueFactoryImpl.isValidSQSTemplate("{{id}}{{entity}}{port}}")); assertFalse(SQSQueueFactoryImpl.isValidSQSTemplate("")); assertFalse(SQSQueueFactoryImpl.isValidSQSTemplate("{{id}}")); assertFalse(SQSQueueFactoryImpl.isValidSQSTemplate("{{entity}}")); assertFalse(SQSQueueFactoryImpl.isValidSQSTemplate("{{port}}")); }
public static boolean isValidSQSTemplate(String template) { return template.contains("{{id}}") && template.contains("{{entity}}") && template.contains("{{port}}"); }
SQSQueueFactoryImpl implements TaskQueueFactory { public static boolean isValidSQSTemplate(String template) { return template.contains("{{id}}") && template.contains("{{entity}}") && template.contains("{{port}}"); } }
SQSQueueFactoryImpl implements TaskQueueFactory { public static boolean isValidSQSTemplate(String template) { return template.contains("{{id}}") && template.contains("{{entity}}") && template.contains("{{port}}"); } SQSQueueFactoryImpl(String template, String region, String queueId, boolean purgeBuffer); }
SQSQueueFactoryImpl implements TaskQueueFactory { public static boolean isValidSQSTemplate(String template) { return template.contains("{{id}}") && template.contains("{{entity}}") && template.contains("{{port}}"); } SQSQueueFactoryImpl(String template, String region, String queueId, boolean purgeBuffer); @Override TaskQueue<T> getTaskQueue(@Nonnull HandlerKey key,
                                                                     int threadNum); @VisibleForTesting String getQueueName(HandlerKey handlerKey); static boolean isValidSQSTemplate(String template); }
SQSQueueFactoryImpl implements TaskQueueFactory { public static boolean isValidSQSTemplate(String template) { return template.contains("{{id}}") && template.contains("{{entity}}") && template.contains("{{port}}"); } SQSQueueFactoryImpl(String template, String region, String queueId, boolean purgeBuffer); @Override TaskQueue<T> getTaskQueue(@Nonnull HandlerKey key,
                                                                     int threadNum); @VisibleForTesting String getQueueName(HandlerKey handlerKey); static boolean isValidSQSTemplate(String template);  }