/*******************************************************************************
 * Copyright (c) 2018 B2i Healthcare. All rights reserved.
 *******************************************************************************/
package com.b2international.snowowl.snomed.api.japi.branches;

import static com.google.common.collect.Lists.newArrayList;
import static org.junit.Assert.assertNull;

import java.util.List;

import org.junit.Test;

import com.b2international.snowowl.core.branch.Branch;
import com.b2international.snowowl.core.events.AsyncRequest;
import com.b2international.snowowl.core.events.util.Promise;
import com.b2international.snowowl.snomed.SnomedConstants.Concepts;
import com.b2international.snowowl.snomed.api.rest.AbstractSnomedApiTest;
import com.b2international.snowowl.snomed.core.domain.SnomedConcepts;
import com.b2international.snowowl.snomed.datastore.SnomedDatastoreActivator;
import com.b2international.snowowl.snomed.datastore.request.SnomedRequests;
import com.google.common.base.Throwables;

public class EclSerializerTest extends AbstractSnomedApiTest {
	
	@Test
	public void verify() throws Exception {
		for (int rounds = 0; rounds < 100; rounds++) {
		
			AsyncRequest<SnomedConcepts> eclRequest = SnomedRequests.prepareSearchConcept()
					.all()
					.filterByEcl("<<" + Concepts.ROOT_CONCEPT + ":" + Concepts.MORPHOLOGY + " = " + Concepts.ROOT_CONCEPT)
					.build(SnomedDatastoreActivator.REPOSITORY_UUID, Branch.MAIN_PATH);
			
			List<Promise<SnomedConcepts>> promises = newArrayList();
			
			for (int i = 0; i < 4; i++) {
				promises.add(eclRequest.execute(getBus()));
			}
			
			final String error = Promise.all(promises)
					.then(concepts -> {
						return (String) null;
					})
					.fail(throwable -> {
						return (throwable.getMessage() != null) 
								? throwable.getMessage() 
								: Throwables.getRootCause(throwable).getClass().getSimpleName();
					})
					.getSync();
			
			assertNull(error, error);
		}
	}
}

@@ -1,84 +1,6 @@
 /*
-******************************************************************************
 %0A * 
@@ -13,12 +13,13 @@
 ght 
-(c) 
+2011-
 2018
@@ -37,110 +37,593 @@
 care
-. All rights reserved.%0A ******************************************************************************
+ Pte Ltd, http://b2i.sg%0A * %0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *%E2%80%82%E2%80%82%E2%80%82%E2%80%82%E2%80%82%E2%80%82http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A 
 */%0Ap
@@ -1422,16 +1422,41 @@
 ables;%0A%0A
+/**%0A * @since 5.12.1%0A */%0A
 public c

Change copyright license add since tag