use of org.talend.services.test.library._1_0.SeekBookError in project tesb-rt-se by Talend.
the class CorrelationFeatureTest method commonTest.
private void commonTest(String testName, String searchFor, String expectedResult) {
LOG.setLevel(Level.FINE);
final String dir = testName;
serviceContext = startParticipants(dir);
retrieveInterceptors(serviceContext);
Library client = (Library) serviceContext.getBean("libraryHttp");
try {
searchFor(searchFor, client);
} catch (SeekBookError e) {
fail("Exception during service call");
}
// assertEquals("Books amount in response differs from 1", 1, booksInResponse(response));
assertNotNull(providerInInterceptor.getLatestCorrelationHeader());
assertTrue(providerInInterceptor.getLatestCorrelationHeader().toString().contains(expectedResult));
// assertNotNull(consumerInInterceptor.getLatestCorrelationHeader());
// System.out.println("PROBLEM: " + consumerInInterceptor.getLatestCorrelationHeader());
// assertTrue(consumerInInterceptor.getLatestCorrelationHeader().toString().contains(expectedResult));
}
use of org.talend.services.test.library._1_0.SeekBookError in project tesb-rt-se by Talend.
the class CorrelationIdAssertionTest method commonTest.
private void commonTest(String testName, String searchFor, String expectedResult) {
final String dir = testName;
serviceContext = startParticipants(dir);
retrieveInterceptors(serviceContext);
Library client = (Library) serviceContext.getBean("libraryHttp");
try {
searchFor(searchFor, client);
} catch (SeekBookError e) {
fail("Exception during service call");
}
// assertEquals("Books amount in response differs from 1", 1, booksInResponse(response));
assertNotNull(consumerOutInterceptor.getLatestCorrelationHeader());
assertNotNull(providerInInterceptor.getLatestCorrelationHeader());
assertTrue(providerInInterceptor.getLatestCorrelationHeader().toString().contains(expectedResult));
assertNotNull(consumerInInterceptor.getLatestCorrelationHeader());
assertTrue(consumerInInterceptor.getLatestCorrelationHeader().toString().contains(expectedResult));
String providerInCorrelationId = providerInInterceptor.getLatestCorrelationHeader().toString();
String consumerInCorrelationId = consumerInInterceptor.getLatestCorrelationHeader().toString();
assertEquals(providerInCorrelationId, consumerInCorrelationId);
}
use of org.talend.services.test.library._1_0.SeekBookError in project tesb-rt-se by Talend.
the class TransformationAssertionTest method commonTest.
private void commonTest(String testName, String searchFor, String expectedResult) {
final String dir = testName;
serviceContext = startParticipants(dir);
Library client = (Library) serviceContext.getBean("libraryHttp");
ListOfBooks response = null;
try {
response = searchFor(searchFor, client);
} catch (SeekBookError e) {
fail("Exception during service call");
}
assertEquals("Books amount in response differs from 1", 1, booksInResponse(response));
assertEquals("Received unexpected author name", expectedResult, authorLastName(response));
}
use of org.talend.services.test.library._1_0.SeekBookError in project tesb-rt-se by Talend.
the class TransformationFeatureTest method commonTest.
private void commonTest(String testName, String searchFor, String expectedResult) {
final String dir = testName;
serviceContext = startProvider(dir);
Library client = (Library) serviceContext.getBean("libraryHttp");
ListOfBooks response = null;
try {
response = searchFor(searchFor, client);
} catch (SeekBookError e) {
fail("Exception during service call");
}
assertEquals("Books amount in response differs from 1", 1, booksInResponse(response));
assertEquals("Received unexpected author name", expectedResult, authorLastName(response));
}
use of org.talend.services.test.library._1_0.SeekBookError in project tesb-rt-se by Talend.
the class LibraryServerImpl method prepareException.
private SeekBookError prepareException(String message) {
ExceptionType exception = new ExceptionType();
exception.setOperation("seekBook");
exception.setServiceName("LibraryService");
exception.setExceptionText(message);
ExceptionFrame frame = new ExceptionFrame();
frame.getException().add(exception);
return new SeekBookError("Book not found", frame);
}
Aggregations