StorageImpl implements ApplicationListener<ContextClosedEvent>, InstancesAware, ProjectsAware, ImagesAware, Storage, OperationsRegistry { @Override public <T> BlockingQueue<T> getQueue(String name) { return isAvailable() ? hazelcastInstance.getQueue(name) : new LinkedBlockingQueue<>(); } @Autowired  StorageImpl(HazelcastInstance hazelcastInstance); @PostConstruct void init(); @Override boolean isAvailable(); @Override BlockingQueue<T> getQueue(String name); @Override Lock getLock(String name); @Override T executeSynchronized(String lockName, long timeout, Supplier<T> action); @Override void modifyMap(String mapId, K key, Consumer<Map<K, T>> action); @Override O readFromMap(String mapId, K key, Function<Map<K, I>, O> function); @Override void saveProject(Project project); @Override void addProjectListener(EntityListener<Project> listener); @Override boolean projectExists(String projectId); @Override Collection<Project> getProjects(); @Override Collection<Project> getProjects(Set<String> ids); @Override Optional<Project> getProject(String projectId); @Override void saveInstance(Instance instance); @Override void deleteInstance(String instanceId); @Override void addInstanceListener(EntityListener<Instance> listener); @Override boolean isInstanceDeleted(String instanceId); @Override boolean instanceExists(String instanceId); @Override Collection<Instance> getInstances(); @Override Collection<Instance> getInstances(Set<String> ids); @Override Optional<Instance> getInstance(String instanceId); @Override boolean imageExists(String imageId); @Override Collection<Image> getImages(); @Override Collection<Image> getImages(Set<String> ids); @Override Optional<Image> getImage(String imageId); @Override void saveImage(Image image); @Override boolean isImageDeleted(String imageId); @Override void deleteImage(String imageId); @Override void addImageListener(EntityListener<Image> listener); @Override void onApplicationEvent(ContextClosedEvent event); @Override Set<OperationType> getOperationTypes(CloudType cloudType); @Override void addOperation(CloudType cloudType, OperationType operationType);  }
@Test public void testGetQueue() { BlockingQueue<Object> queue = storage.getQueue("test"); assertThat(queue, hasSize(0)); queue.add("test"); assertThat(queue, contains("test")); }