/** @return string */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "\nRemoteHttpCacheResponse" ); buf.append( "\n success [" + isSuccess() + "]" ); buf.append( "\n payload [" + getPayload() + "]" ); buf.append( "\n errorMessage [" + getErrorMessage() + "]" ); return buf.toString(); } }
/** @return string */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "\nRemoteHttpCacheResponse" ); buf.append( "\n success [" + isSuccess() + "]" ); buf.append( "\n payload [" + getPayload() + "]" ); buf.append( "\n errorMessage [" + getErrorMessage() + "]" ); return buf.toString(); } }
/** Verify that we balk and return an error. */ public void testProcessRequest_null() { RemoteCacheRequest<Serializable, Serializable> request = null; // DO WORK RemoteCacheResponse<Object> result = servlet.processRequest( request ); // VERIFY assertNotNull( "Should have a result.", result ); assertTrue( "Should have 'The request is null' in the errorMessage", result.getErrorMessage().indexOf( "The request is null" ) != -1 ); assertTrue( "Should have 'The request is null' in the toString", result.toString().indexOf( "The request is null" ) != -1 ); }
/** Verify that we balk and return an error. */ public void testProcessRequest_null() { // SETUP RemoteCacheServiceAdaptor<String, String> adaptor = new RemoteCacheServiceAdaptor<String, String>(); MockRemoteCacheService<String, String> remoteHttpCacheService = new MockRemoteCacheService<String, String>(); adaptor.setRemoteCacheService( remoteHttpCacheService ); RemoteCacheRequest<String, String> request = null; // DO WORK RemoteCacheResponse<String> result = adaptor.processRequest( request ); // VERIFY assertNotNull( "Should have a result.", result ); assertTrue( "Should have 'The request is null' in the errorMessage", result.getErrorMessage().indexOf( "The request is null" ) != -1 ); assertTrue( "Should have 'The request is null' in the toString", result.toString().indexOf( "The request is null" ) != -1 ); }