target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testGetBooleanProperty() { JMSProducer producer = context.createProducer(); producer.setProperty(BOOLEAN_PROPERTY_NAME, BOOLEAN_PROPERTY_VALUE); assertEquals(BOOLEAN_PROPERTY_VALUE, producer.getBooleanProperty(BOOLEAN_PROPERTY_NAME)); } | @Override public boolean getBooleanProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Boolean.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } | JmsPoolJMSProducer implements JMSProducer { @Override public boolean getBooleanProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Boolean.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } } | JmsPoolJMSProducer implements JMSProducer { @Override public boolean getBooleanProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Boolean.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession session, Jm... | JmsPoolJMSProducer implements JMSProducer { @Override public boolean getBooleanProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Boolean.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession session, Jm... | JmsPoolJMSProducer implements JMSProducer { @Override public boolean getBooleanProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Boolean.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession session, Jm... |
@Test public void testGetShortProperty() { JMSProducer producer = context.createProducer(); producer.setProperty(SHORT_PROPERTY_NAME, SHORT_PROPERTY_VALUE); assertEquals(SHORT_PROPERTY_VALUE, producer.getShortProperty(SHORT_PROPERTY_NAME)); } | @Override public short getShortProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Short.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } | JmsPoolJMSProducer implements JMSProducer { @Override public short getShortProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Short.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } } | JmsPoolJMSProducer implements JMSProducer { @Override public short getShortProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Short.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession session, JmsPoolM... | JmsPoolJMSProducer implements JMSProducer { @Override public short getShortProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Short.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession session, JmsPoolM... | JmsPoolJMSProducer implements JMSProducer { @Override public short getShortProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Short.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession session, JmsPoolM... |
@Test public void testCreateAssignsLinkedException() { JMSException result = JMSExceptionSupport.create(ERROR_MESSAGE, new IOException(CAUSE_MESSAGE)); assertNotNull(result.getLinkedException()); } | public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... |
@Test public void testCreateUsesCauseIfJMSExceptionPresent() { IOException ioe = new IOException("Ignore me", new JMSSecurityException("error")); JMSException result = JMSExceptionSupport.create(ERROR_MESSAGE, ioe); assertNotNull(result); assertTrue(result instanceof JMSSecurityException); } | public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... |
@Test public void testCreateDoesNotFillLinkedExceptionWhenGivenNonExceptionThrowable() { JMSException result = JMSExceptionSupport.create(ERROR_MESSAGE, new AssertionError(CAUSE_MESSAGE)); assertNull(result.getLinkedException()); } | public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... |
@Test public void testCreateFillsMessageFromMessageParam() { JMSException result = JMSExceptionSupport.create(ERROR_MESSAGE, new IOException(CAUSE_MESSAGE)); assertEquals(ERROR_MESSAGE, result.getMessage()); } | public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... |
@Test public void testCreateFillsMessageFromMCauseessageParamMessage() { JMSException result = JMSExceptionSupport.create(new IOException(CAUSE_MESSAGE)); assertEquals(CAUSE_MESSAGE, result.getMessage()); } | public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... |
@Test public void testCreateFillsMessageFromMCauseessageParamToString() { JMSException result = JMSExceptionSupport.create(NO_MESSAGE_CAUSE); assertEquals(NO_MESSAGE_CAUSE.toString(), result.getMessage()); } | public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... |
@Test public void testCreateFillsMessageFromMCauseessageParamToStringWhenMessageIsEmpty() { JMSException result = JMSExceptionSupport.create(EMPTY_MESSAGE_CAUSE); assertEquals(EMPTY_MESSAGE_CAUSE.toString(), result.getMessage()); } | public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... |
@Test public void testCreateFillsMessageFromCauseMessageParamWhenErrorMessageIsNull() { JMSException result = JMSExceptionSupport.create(null, new IOException(CAUSE_MESSAGE)); assertEquals(CAUSE_MESSAGE, result.getMessage()); } | public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... |
@Test public void testCreateFillsMessageFromCauseMessageParamWhenErrorMessageIsEmpty() { JMSException result = JMSExceptionSupport.create("", new IOException(CAUSE_MESSAGE)); assertEquals(CAUSE_MESSAGE, result.getMessage()); } | public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(); if (message == null... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... | JMSExceptionSupport { public static JMSException create(String message, Throwable cause) { if (cause instanceof JMSException) { return (JMSException) cause; } if (cause.getCause() instanceof JMSException) { return (JMSException) cause.getCause(); } if (message == null || message.isEmpty()) { message = cause.getMessage(... |
@Test public void testGetLongProperty() { JMSProducer producer = context.createProducer(); producer.setProperty(LONG_PROPERTY_NAME, LONG_PROPERTY_VALUE); assertEquals(LONG_PROPERTY_VALUE, producer.getLongProperty(LONG_PROPERTY_NAME)); } | @Override public long getLongProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Long.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } | JmsPoolJMSProducer implements JMSProducer { @Override public long getLongProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Long.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } } | JmsPoolJMSProducer implements JMSProducer { @Override public long getLongProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Long.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession session, JmsPoolMess... | JmsPoolJMSProducer implements JMSProducer { @Override public long getLongProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Long.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession session, JmsPoolMess... | JmsPoolJMSProducer implements JMSProducer { @Override public long getLongProperty(String name) { try { return convertPropertyTo(name, messageProperties.get(name), Long.class); } catch (JMSException jmse) { throw JMSExceptionSupport.createRuntimeException(jmse); } } JmsPoolJMSProducer(JmsPoolSession session, JmsPoolMess... |
@Test public void testMd5() { String source = "123456"; PerformanceMonitor.start("DigestUtilsTest"); for (int i = 0; i < 5; i++) { for (int j = 0; j < 10000; j++) { Assert.assertEquals("e10adc3949ba59abbe56e057f20f883e", DigestUtils.digest(MessageDigestAlgorithms.MD5, source)); } PerformanceMonitor.mark("md5 Test"); } ... | public static byte[] digest(MessageDigest digest, byte[] data) { return digest.digest(data); } | DigestUtils { public static byte[] digest(MessageDigest digest, byte[] data) { return digest.digest(data); } } | DigestUtils { public static byte[] digest(MessageDigest digest, byte[] data) { return digest.digest(data); } } | DigestUtils { public static byte[] digest(MessageDigest digest, byte[] data) { return digest.digest(data); } static byte[] digest(MessageDigest digest, byte[] data); static MessageDigest updateDigest(MessageDigest messageDigest, byte[] valueToDigest); static byte[] digest(MessageDigest digest, InputStream data); stati... | DigestUtils { public static byte[] digest(MessageDigest digest, byte[] data) { return digest.digest(data); } static byte[] digest(MessageDigest digest, byte[] data); static MessageDigest updateDigest(MessageDigest messageDigest, byte[] valueToDigest); static byte[] digest(MessageDigest digest, InputStream data); stati... |
@Test public void testIsPositiveNumber() { Assert.assertFalse(NumberUtils.isPositiveNumber(-1L)); Assert.assertFalse(NumberUtils.isPositiveNumber(-10000000000000000L)); Assert.assertFalse(NumberUtils.isPositiveNumber(0)); Assert.assertFalse(NumberUtils.isPositiveNumber(1.6)); Assert.assertTrue(NumberUtils.isPositiveNum... | public static boolean isPositiveNumber(Number number) { if (number == null) return false; return org.apache.commons.lang3.math.NumberUtils.isDigits(number.toString()) && number.byteValue() > 0; } | NumberUtils { public static boolean isPositiveNumber(Number number) { if (number == null) return false; return org.apache.commons.lang3.math.NumberUtils.isDigits(number.toString()) && number.byteValue() > 0; } } | NumberUtils { public static boolean isPositiveNumber(Number number) { if (number == null) return false; return org.apache.commons.lang3.math.NumberUtils.isDigits(number.toString()) && number.byteValue() > 0; } } | NumberUtils { public static boolean isPositiveNumber(Number number) { if (number == null) return false; return org.apache.commons.lang3.math.NumberUtils.isDigits(number.toString()) && number.byteValue() > 0; } static int toInt(String str); static long toLong(String str); static float toFloat(String str); static float ... | NumberUtils { public static boolean isPositiveNumber(Number number) { if (number == null) return false; return org.apache.commons.lang3.math.NumberUtils.isDigits(number.toString()) && number.byteValue() > 0; } static int toInt(String str); static long toLong(String str); static float toFloat(String str); static float ... |
@Test public void testBeanToBean() { Person person = new Person("Daniel Li", 24); PerformanceMonitor.start("BeanUtilsTest"); for (int i = 0; i < 5; i++) { for (int j = 0; j < 50000; j++) { PersonDto personDto = new PersonDto(); BeanUtils.copyProperties(person, personDto); } PerformanceMonitor.mark("BeanUtils" + i); } B... | public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } | BeanUtils { public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } } | BeanUtils { public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } } | BeanUtils { public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } static void copyProperties(Object source, Object target); static void copyProperties(Object source, String[] copyProperties, Object target); static v... | BeanUtils { public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } static void copyProperties(Object source, Object target); static void copyProperties(Object source, String[] copyProperties, Object target); static v... |
@Test public void testBeanToMapping() { Person person = new Person("Daniel Li", 24); PerformanceMonitor.start("BeanUtilsTest"); for (int i = 0; i < 5; i++) { for (int j = 0; j < 50000; j++) { Map<String, Object> map = new HashMap<>(); BeanUtils.copyProperties(person, map); } PerformanceMonitor.mark("BeanUtils" + i); } ... | public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } | BeanUtils { public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } } | BeanUtils { public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } } | BeanUtils { public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } static void copyProperties(Object source, Object target); static void copyProperties(Object source, String[] copyProperties, Object target); static v... | BeanUtils { public static void copyProperties(Object source, Object target) throws BeansException { org.springframework.beans.BeanUtils.copyProperties(source, target); } static void copyProperties(Object source, Object target); static void copyProperties(Object source, String[] copyProperties, Object target); static v... |
@Test public void test1() { DateTime date = new DateTime(); Employee employee1 = new Employee("Daniel Li", 20, date); Employee employee2 = new Employee("Daniel Li", 20, date); Manager manager1 = new Manager("Daniel Li", 20, date, 0); Manager manager2 = new Manager("Daniel Li", 20, date, 0) { }; PerformanceMonitor.start... | public static int reflectionHashCode(Object object) { return reflectionHashCode(17, 37, object); } | HashCodeBuilderUtils { public static int reflectionHashCode(Object object) { return reflectionHashCode(17, 37, object); } } | HashCodeBuilderUtils { public static int reflectionHashCode(Object object) { return reflectionHashCode(17, 37, object); } } | HashCodeBuilderUtils { public static int reflectionHashCode(Object object) { return reflectionHashCode(17, 37, object); } static int reflectionHashCode(Object object); static int reflectionHashCode(int initialNonZeroOddNumber, int multiplierNonZeroOddNumber, T object); } | HashCodeBuilderUtils { public static int reflectionHashCode(Object object) { return reflectionHashCode(17, 37, object); } static int reflectionHashCode(Object object); static int reflectionHashCode(int initialNonZeroOddNumber, int multiplierNonZeroOddNumber, T object); } |
@Test public void test1() { DateTime date = new DateTime(); Employee employee1 = new Employee("Daniel Li", 20, date); Employee employee2 = new Employee("Daniel Li", 20, date); Manager manager1 = new Manager("Daniel Li", 20, date, 0); Manager manager2 = new Manager("Daniel Li", 20, date, 0) { }; PerformanceMonitor.start... | public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, builder); } return builder.... | ToStringBuilderUtils { public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, buil... | ToStringBuilderUtils { public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, buil... | ToStringBuilderUtils { public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, buil... | ToStringBuilderUtils { public static String reflectionToString(Object object) { ToStringBuilder builder = new ToStringBuilder(object); Class<?> clazz = object.getClass(); reflectionAppend(object, clazz, builder); while (clazz.getSuperclass() != null) { clazz = clazz.getSuperclass(); reflectionAppend(object, clazz, buil... |
@Test public void test() { ApplicationContext applicationContext = BeanFactoryContext.currentApplicationContext(); LOGGER.info(ApplicationContextUtils.getMessage(applicationContext, Locale.CHINA, "helloWorld")); LOGGER.info(ApplicationContextUtils.getMessage(applicationContext, Locale.US, "helloWorld")); if (Applicatio... | public T getContent() { return content; } | Message { public T getContent() { return content; } } | Message { public T getContent() { return content; } Message(MessageType type, T content); } | Message { public T getContent() { return content; } Message(MessageType type, T content); MessageType getType(); T getContent(); } | Message { public T getContent() { return content; } Message(MessageType type, T content); MessageType getType(); T getContent(); } |
@Test public void executionIdShouldNotBeNullForRunRequestExecution() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Execution id should not be null"); restApiUnderTest.runExportExecution(null, ExecutionRequestOptions.create()); } | @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution options should not be null"... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... |
@Test public void requestForSearchShouldParseHeaderResultCount() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(searchResponse.asString()) .addHeader("Result-Count", "100"); mWebMockRule.enqueue(mockResponse); ResourceSearchResult response = restApiUnderTest.searchResources(null... | @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchParams, url); Request r... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... |
@Test public void requestForSearchShouldParseHeaderTotalCount() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(searchResponse.asString()) .addHeader("Total-Count", "1000"); mWebMockRule.enqueue(mockResponse); ResourceSearchResult response = restApiUnderTest.searchResources(null)... | @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchParams, url); Request r... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... |
@Test public void requestForSearchShouldParseHeaderStartIndex() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(searchResponse.asString()) .addHeader("Start-Index", "5"); mWebMockRule.enqueue(mockResponse); ResourceSearchResult response = restApiUnderTest.searchResources(null); a... | @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchParams, url); Request r... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... |
@Test public void requestForSearchShouldParseHeaderNextOffset() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(searchResponse.asString()) .addHeader("Next-Offset", "10"); mWebMockRule.enqueue(mockResponse); ResourceSearchResult response = restApiUnderTest.searchResources(null); ... | @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchParams, url); Request r... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... |
@Test public void requestForResourceByTypeShouldNotAcceptNullType() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Report type should not be null"); restApiUnderTest.requestResource("/", null); } | @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2")... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... |
@Test public void requestForResourceByTypeShouldNotAcceptNullUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Report uri should not be null"); restApiUnderTest.requestResource(null, "file"); } | @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2")... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... |
@Test public void requestForFileContentShouldNotAcceptNullUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Resource uri should not be null"); restApiUnderTest.requestResourceOutput(null); } | @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build() .resolve(mNetworkCl... | RepositoryRestApi { @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build()... | RepositoryRestApi { @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build()... | RepositoryRestApi { @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build()... | RepositoryRestApi { @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build()... |
@Test public void requestForRequestDashboardComponentsdNotAcceptNullUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Dashboard uri should not be null"); restApiUnderTest.requestDashboardComponents(null); } | @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(dashboardUri + "_fi... | RepositoryRestApi { @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths... | RepositoryRestApi { @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths... | RepositoryRestApi { @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths... | RepositoryRestApi { @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths... |
@Test public void searchResourcesShouldThrowRestErrorOn500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.searchResources(null); } | @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchParams, url); Request r... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... |
@Test public void searchEndpointShouldHandleMultipleResourceTypes() throws Exception { MockResponse response = MockResponseFactory.create200() .setBody("{\"resourceLookup\": []}"); mWebMockRule.enqueue(response); Map<String, Object> params = new HashMap<>(); params.put("folderUri", "/"); Set<String> types = new HashSet... | @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchParams, url); Request r... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... |
@Test public void requestForAttachmentShouldBeWrappedInsideInput() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(mResource.asString()); mWebMockRule.enqueue(mockResponse); OutputResource resource = restApiUnderTest.requestExportAttachment("any_id", "any_id", "any_id"); InputStr... | @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); Utils.checkNot... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... |
@Test public void shouldSearchResources() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create204()); Map<String, Object> params = new LinkedHashMap<>(); params.put("limit", 100); params.put("offset", 100); restApiUnderTest.searchResources(params); RecordedRequest request = mWebMockRule.get().takeRequest(... | @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchParams, url); Request r... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... |
@Test public void shouldRequestDashboardComponents() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create200()); restApiUnderTest.requestDashboardComponents("/my/uri"); RecordedRequest request = mWebMockRule.get().takeRequest(); assertThat(request, containsHeader("Accept", "application/dashboardComponents... | @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(dashboardUri + "_fi... | RepositoryRestApi { @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths... | RepositoryRestApi { @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths... | RepositoryRestApi { @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths... | RepositoryRestApi { @NotNull public DashboardComponentCollection requestDashboardComponents(@NotNull String dashboardUri) throws IOException, HttpException { Utils.checkNotNull(dashboardUri, "Dashboard uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths... |
@Test public void shouldRequestFileContent() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create200()); restApiUnderTest.requestResourceOutput("/my/uri"); RecordedRequest request = mWebMockRule.get().takeRequest(); assertThat(request, hasPath("/rest_v2/resources/my/uri")); assertThat(request, wasMethod("... | @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build() .resolve(mNetworkCl... | RepositoryRestApi { @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build()... | RepositoryRestApi { @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build()... | RepositoryRestApi { @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build()... | RepositoryRestApi { @NotNull public OutputResource requestResourceOutput(@NotNull String resourceUri) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Resource uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("resources") .addPaths(resourceUri) .build()... |
@Test @Parameters({ "reportUnit|com.jaspersoft.android.sdk.network.entity.resource.ReportLookup", "folder|com.jaspersoft.android.sdk.network.entity.resource.FolderLookup", "file|com.jaspersoft.android.sdk.network.entity.resource.FileLookup" }) public void shouldRequestReportResources(String type, String className) thro... | @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2")... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... | RepositoryRestApi { @NotNull public ResourceLookup requestResource(@NotNull String resourceUri, @NotNull String type) throws IOException, HttpException { Utils.checkNotNull(resourceUri, "Report uri should not be null"); Utils.checkNotNull(type, "Report type should not be null"); HttpUrl url = new PathResolver.Builder()... |
@Test public void testCreate() throws Exception { SpringAuthService service = authServiceFactory.create(); assertThat(service, is(notNullValue())); } | public SpringAuthService create() { AuthRestApi restApi = new AuthRestApi(mClient); JSEncryptionAlgorithm encryptionAlgorithm = JSEncryptionAlgorithm.create(); return new SpringAuthService(restApi, encryptionAlgorithm); } | SpringAuthServiceFactory { public SpringAuthService create() { AuthRestApi restApi = new AuthRestApi(mClient); JSEncryptionAlgorithm encryptionAlgorithm = JSEncryptionAlgorithm.create(); return new SpringAuthService(restApi, encryptionAlgorithm); } } | SpringAuthServiceFactory { public SpringAuthService create() { AuthRestApi restApi = new AuthRestApi(mClient); JSEncryptionAlgorithm encryptionAlgorithm = JSEncryptionAlgorithm.create(); return new SpringAuthService(restApi, encryptionAlgorithm); } SpringAuthServiceFactory(NetworkClient client); } | SpringAuthServiceFactory { public SpringAuthService create() { AuthRestApi restApi = new AuthRestApi(mClient); JSEncryptionAlgorithm encryptionAlgorithm = JSEncryptionAlgorithm.create(); return new SpringAuthService(restApi, encryptionAlgorithm); } SpringAuthServiceFactory(NetworkClient client); SpringAuthService creat... | SpringAuthServiceFactory { public SpringAuthService create() { AuthRestApi restApi = new AuthRestApi(mClient); JSEncryptionAlgorithm encryptionAlgorithm = JSEncryptionAlgorithm.create(); return new SpringAuthService(restApi, encryptionAlgorithm); } SpringAuthServiceFactory(NetworkClient client); SpringAuthService creat... |
@Test public void normalizeBaseUrlShouldAddTrailingSlashIfMissing() { String url = "http: assertThat(Utils.normalizeBaseUrl(url), is(url + "/")); } | public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } } | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); } | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); static T checkNotNull(T object, String message); static void checkArgument(boolean condition, String message); static int headerT... | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); static T checkNotNull(T object, String message); static void checkArgument(boolean condition, String message); static int headerT... |
@Test public void normalizeBaseUrlShouldNotNormalizeEmptyString() { String url = ""; assertThat(Utils.normalizeBaseUrl(url), is("")); } | public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } } | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); } | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); static T checkNotNull(T object, String message); static void checkArgument(boolean condition, String message); static int headerT... | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); static T checkNotNull(T object, String message); static void checkArgument(boolean condition, String message); static int headerT... |
@Test public void normalizeBaseUrlShouldNotNormalizeNullString() { String url = null; assertThat(Utils.normalizeBaseUrl(url), is(nullValue())); } | public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } } | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); } | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); static T checkNotNull(T object, String message); static void checkArgument(boolean condition, String message); static int headerT... | Utils { public static String normalizeBaseUrl(String url) { if (url == null || url.length() == 0) { return url; } if (url.endsWith("/")) { return url; } return url + "/"; } private Utils(); static T checkNotNull(T object, String message); static void checkArgument(boolean condition, String message); static int headerT... |
@Test public void testEquals() throws Exception { EqualsVerifier.forClass(JobData.class).verify(); } | @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JobData)) return false; JobData jobData = (JobData) o; if (mId != jobData.mId) return false; if (mVersion != jobData.mVersion) return false; if (!mCreationDate.equals(jobData.mCreationDate)) return false; if (!mDescription.... | JobData { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JobData)) return false; JobData jobData = (JobData) o; if (mId != jobData.mId) return false; if (mVersion != jobData.mVersion) return false; if (!mCreationDate.equals(jobData.mCreationDate)) return false; if (!mDe... | JobData { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JobData)) return false; JobData jobData = (JobData) o; if (mId != jobData.mId) return false; if (mVersion != jobData.mVersion) return false; if (!mCreationDate.equals(jobData.mCreationDate)) return false; if (!mDe... | JobData { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JobData)) return false; JobData jobData = (JobData) o; if (mId != jobData.mId) return false; if (mVersion != jobData.mVersion) return false; if (!mCreationDate.equals(jobData.mCreationDate)) return false; if (!mDe... | JobData { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof JobData)) return false; JobData jobData = (JobData) o; if (mId != jobData.mId) return false; if (mVersion != jobData.mVersion) return false; if (!mCreationDate.equals(jobData.mCreationDate)) return false; if (!mDe... |
@Test public void should_throw_if_lower_bound_higher_than_upper_one() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("start must be lesser than end."); mTimePattern.setRange(10, 0); } | public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentException("start must ... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... |
@Test public void shouldRequestExportAttachment() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody(mResource.asString()); mWebMockRule.enqueue(mockResponse); restApiUnderTest.requestExportAttachment(EXECUTION_ID, "html;pages=1", "attachment_id"); RecordedRequest request = mWebMock... | @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); Utils.checkNot... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... |
@Test public void should_throw_if_start_less_than_lower_bound() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("start cannot be less than lower bound."); mTimePattern.setRange(-10, 0); } | public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentException("start must ... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... |
@Test public void should_throw_if_upper_bound_negative() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("end cannot be more than upper bound."); mTimePattern.setRange(0, 200); } | public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentException("start must ... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... | TimePattern { public void setRange(int start, int end) { if (start < mLowerBound) { throw new IllegalArgumentException("start cannot be less than lower bound."); } if (end > mHigherBound) { throw new IllegalArgumentException("end cannot be more than upper bound."); } if (start > end) { throw new IllegalArgumentExceptio... |
@Test public void should_not_accept_value_that_less_than_lower_bound() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("Value should be within bounds [ 0, 59 ]"); mTimePattern.setValue(-10); } | public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } | TimePattern { public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } } | TimePattern { public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } TimePattern(int lowerBound, int higherBound); } | TimePattern { public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } TimePattern(int lowerBound, int higherBound); void setRange(int start, int end); @Override S... | TimePattern { public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } TimePattern(int lowerBound, int higherBound); void setRange(int start, int end); @Override S... |
@Test public void should_not_accept_value_that_more_than_upper_bound() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("Value should be within bounds [ 0, 59 ]"); mTimePattern.setValue(100); } | public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } | TimePattern { public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } } | TimePattern { public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } TimePattern(int lowerBound, int higherBound); } | TimePattern { public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } TimePattern(int lowerBound, int higherBound); void setRange(int start, int end); @Override S... | TimePattern { public void setValue(int value) { validateWithinBounds(value, String.format("Value should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.append(String.valueOf(value)); } TimePattern(int lowerBound, int higherBound); void setRange(int start, int end); @Override S... |
@Test public void should_not_accept_interval_that_less_than_lower_bound() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("Interval should be within bounds [ 0, 59 ]"); mTimePattern.setIncrement(-10, 5); } | public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.app... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... |
@Test public void should_not_accept_interval_that_more_than_upper_bound() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("Interval should be within bounds [ 0, 59 ]"); mTimePattern.setIncrement(100, -5); } | public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.app... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... |
@Test public void should_not_accept_from_that_less_than_lower_bound() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("From should be within bounds [ 0, 59 ]"); mTimePattern.setIncrement(0, -5); } | public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.app... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... |
@Test public void should_not_accept_from_that_more_than_upper_bound() throws Exception { expected.expect(IllegalArgumentException.class); expected.expectMessage("From should be within bounds [ 0, 59 ]"); mTimePattern.setIncrement(0, 100); } | public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0); mPattern.app... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... | TimePattern { public void setIncrement(int interval, int from) { validateWithinBounds(interval, String.format("Interval should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); validateWithinBounds(from, String.format("From should be within bounds [ %d, %d ]", mLowerBound, mHigherBound)); mPattern.setLength(0)... |
@Test public void should_use_default_folder_uri_if_one_not_supplied() throws Exception { RepositoryDestination destination = new RepositoryDestination.Builder().build(); assertThat(destination.getUseDefaultReportOutputFolderURI(), is(true)); } | @Nullable public Boolean getUseDefaultReportOutputFolderURI() { return useDefaultReportOutputFolderURI; } | RepositoryDestination { @Nullable public Boolean getUseDefaultReportOutputFolderURI() { return useDefaultReportOutputFolderURI; } } | RepositoryDestination { @Nullable public Boolean getUseDefaultReportOutputFolderURI() { return useDefaultReportOutputFolderURI; } RepositoryDestination(Builder builder); } | RepositoryDestination { @Nullable public Boolean getUseDefaultReportOutputFolderURI() { return useDefaultReportOutputFolderURI; } RepositoryDestination(Builder builder); @Nullable Boolean getSequentialFileNames(); @Nullable Boolean getOverwriteFiles(); @Nullable Boolean getSaveToRepository(); @Nullable Boolean getUseDe... | RepositoryDestination { @Nullable public Boolean getUseDefaultReportOutputFolderURI() { return useDefaultReportOutputFolderURI; } RepositoryDestination(Builder builder); @Nullable Boolean getSequentialFileNames(); @Nullable Boolean getOverwriteFiles(); @Nullable Boolean getSaveToRepository(); @Nullable Boolean getUseDe... |
@Test public void testEquals() throws Exception { EqualsVerifier.forClass(ReportMetadata.class).verify(); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportMetadata that = (ReportMetadata) o; if (totalPages != that.totalPages) return false; if (uri != null ? !uri.equals(that.uri) : that.uri != null) return false; return true; } | ReportMetadata { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportMetadata that = (ReportMetadata) o; if (totalPages != that.totalPages) return false; if (uri != null ? !uri.equals(that.uri) : that.uri != null) return false; return ... | ReportMetadata { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportMetadata that = (ReportMetadata) o; if (totalPages != that.totalPages) return false; if (uri != null ? !uri.equals(that.uri) : that.uri != null) return false; return ... | ReportMetadata { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportMetadata that = (ReportMetadata) o; if (totalPages != that.totalPages) return false; if (uri != null ? !uri.equals(that.uri) : that.uri != null) return false; return ... | ReportMetadata { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportMetadata that = (ReportMetadata) o; if (totalPages != that.totalPages) return false; if (uri != null ? !uri.equals(that.uri) : that.uri != null) return false; return ... |
@Test public void shouldRunExportExecution() throws Exception { MockResponse mockResponse = MockResponseFactory.create200(); mWebMockRule.enqueue(mockResponse); restApiUnderTest.runExportExecution(EXECUTION_ID, ExecutionRequestOptions.create()); RecordedRequest request = mWebMockRule.get().takeRequest(); assertThat(req... | @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution options should not be null"... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... |
@Test public void testEquals() throws Exception { EqualsVerifier.forClass(ReportOption.class).verify(); } | @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ReportOption)) return false; ReportOption that = (ReportOption) o; if (!id.equals(that.id)) return false; if (!label.equals(that.label)) return false; if (!uri.equals(that.uri)) return false; return true; } | ReportOption { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ReportOption)) return false; ReportOption that = (ReportOption) o; if (!id.equals(that.id)) return false; if (!label.equals(that.label)) return false; if (!uri.equals(that.uri)) return false; return true; } } | ReportOption { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ReportOption)) return false; ReportOption that = (ReportOption) o; if (!id.equals(that.id)) return false; if (!label.equals(that.label)) return false; if (!uri.equals(that.uri)) return false; return true; } p... | ReportOption { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ReportOption)) return false; ReportOption that = (ReportOption) o; if (!id.equals(that.id)) return false; if (!label.equals(that.label)) return false; if (!uri.equals(that.uri)) return false; return true; } p... | ReportOption { @Override public final boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ReportOption)) return false; ReportOption that = (ReportOption) o; if (!id.equals(that.id)) return false; if (!label.equals(that.label)) return false; if (!uri.equals(that.uri)) return false; return true; } p... |
@Test public void throwsNumberFormatExceptionIfLowerBoundNotANumber() { mExpectedException.expect(NumberFormatException.class); PageRange.parse("q"); } | @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } } | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, int upperBound);... | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, int upperBound);... | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, int upperBound);... |
@Test public void throwsNumberFormatExceptionIfUpperBoundNotANumber() { mExpectedException.expect(NumberFormatException.class); PageRange.parse("1-q"); } | @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } } | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, int upperBound);... | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, int upperBound);... | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, int upperBound);... |
@Test public void should_not_allow_null() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Pages should not be null"); PageRange.parse(null); } | @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } } | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, int upperBound);... | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, int upperBound);... | PageRange { @NotNull public static PageRange parse(@NotNull String pages) { Preconditions.checkNotNull(pages, "Pages should not be null"); int lowerBound = parseLowerBound(pages); int upperBound = parseUpperBound(pages); return new PageRange(lowerBound, upperBound); } private PageRange(int lowerBound, int upperBound);... |
@Test public void testEquals() throws Exception { EqualsVerifier.forClass(PageRange.class).verify(); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PageRange pageRange = (PageRange) o; if (mLowerBound != pageRange.mLowerBound) return false; if (mUpperBound != pageRange.mUpperBound) return false; return true; } | PageRange { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PageRange pageRange = (PageRange) o; if (mLowerBound != pageRange.mLowerBound) return false; if (mUpperBound != pageRange.mUpperBound) return false; return true; } } | PageRange { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PageRange pageRange = (PageRange) o; if (mLowerBound != pageRange.mLowerBound) return false; if (mUpperBound != pageRange.mUpperBound) return false; return true; } private Page... | PageRange { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PageRange pageRange = (PageRange) o; if (mLowerBound != pageRange.mLowerBound) return false; if (mUpperBound != pageRange.mUpperBound) return false; return true; } private Page... | PageRange { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PageRange pageRange = (PageRange) o; if (mLowerBound != pageRange.mLowerBound) return false; if (mUpperBound != pageRange.mUpperBound) return false; return true; } private Page... |
@Test @Parameters({ "5.0.0, 5", "5.1.0, 5.1", "5.2.0, 5.2", "5.5.0, 5.5", "5.6.0, 5.6", "5.6.1, 5.61", "6.0, 6", "6.0.1, 6.01", "6.1, 6.1", "6.1.1, 6.11", }) public void shouldParseSemanticVersioning(String versionCode, String expected) { double expectedCode = Double.valueOf(expected); double resultCode = VersionParser... | public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... |
@Test @Parameters({ "5.61, 5.61", "6.01, 6.01" }) public void shouldParseValidDouble(String versionCode, String expected) { double expectedCode = Double.valueOf(expected); double resultCode = VersionParser.toDouble(versionCode); assertThat(resultCode, Is.is(expectedCode)); } | public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... |
@Test @Parameters({ "5.6.1.2, 5.612", "5.6.1.2.0, 5.612", "5.5.6.1.2, 5.5612", "5.5.6.1.2.0, 5.5612", "5.5.6.1.2.3, 5.56123", "5.5.6.1.2.3.0, 5.56123", }) public void shouldParseLongSemanticVersioning(String versionCode, String expected) { double expectedCode = Double.valueOf(expected); double resultCode = VersionParse... | public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... |
@Test @Parameters({ "0, 0", "0.0, 0", "1-asdasdsad, 1", "1-asdasdsad2, 1", "12-asdasdsad2, 12", }) public void shouldParseIfHasNumber(String version, String result) { double resultCode = VersionParser.toDouble(version); assertThat(resultCode, Is.is(Double.valueOf(result))); } | public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... |
@Test @Parameters({ "invalid", ".-", "" }) public void shouldReturnZeroForIncorrectVersion(String invalidVersion) { assertThat(String.format("Version '%s' should be treated as zero", invalidVersion), VersionParser.toDouble(invalidVersion), is(-1d)); } | public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } } | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... | VersionParser { public static double toDouble(String version) { if (version != null) { try { return Double.parseDouble(version); } catch (NumberFormatException ex) { if (version.contains(".")) { return parseAsVersionName(version); } else { return parseAsNumber(version); } } } return INVALID_VERSION; } private VersionP... |
@Test public void shouldCheckExportExecutionStatus() throws Exception { MockResponse mockResponse = MockResponseFactory.create200(); mWebMockRule.enqueue(mockResponse); restApiUnderTest.checkExportExecutionStatus(EXECUTION_ID, "html;pages=1"); RecordedRequest request = mWebMockRule.get().takeRequest(); assertThat(reque... | @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new PathResolver.Builder()... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... |
@Test public void list_dashboard_components() throws Exception { useCase.requestDashboardComponents(DASHBOARD_URI); verify(mRepositoryRestApi).requestDashboardComponents(DASHBOARD_URI); } | public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... |
@Test public void list_dashboard_components_adapts_io_exception() throws Exception { when(mRepositoryRestApi.requestDashboardComponents(anyString())).thenThrow(mIOException); try { useCase.requestDashboardComponents(DASHBOARD_URI); fail("Should adapt IO exception"); } catch (ServiceException ex) { verify(mExceptionMapp... | public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... |
@Test public void list_dashboard_components_adapts_http_exception() throws Exception { when(mRepositoryRestApi.requestDashboardComponents(anyString())).thenThrow(mHttpException); try { useCase.requestDashboardComponents(DASHBOARD_URI); fail("Should adapt HTTP exception"); } catch (ServiceException ex) { verify(mExcepti... | public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... | RepositoryUseCase { public DashboardComponentCollection requestDashboardComponents(String dashboardUri) throws ServiceException { try { return mRestApi.requestDashboardComponents(dashboardUri); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e)... |
@Test public void should_map_entities_to_data_objects() throws Exception { Set<ReportOption> expected = mReportOptionMapper.transform(Collections.singleton(mEntity)); assertThat(expected, is(not(empty()))); } | public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } | ReportOptionMapper { public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } } | ReportOptionMapper { public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } } | ReportOptionMapper { public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } Set<ReportOption... | ReportOptionMapper { public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } Set<ReportOption... |
@Test public void should_map_entity_to_data_object() throws Exception { ReportOption expected = mReportOptionMapper.transform(mEntity); assertThat(expected.getId(), is("id")); assertThat(expected.getUri(), is("/my/uri")); assertThat(expected.getLabel(), is("label")); } | public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } | ReportOptionMapper { public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } } | ReportOptionMapper { public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } } | ReportOptionMapper { public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } Set<ReportOption... | ReportOptionMapper { public Set<ReportOption> transform(Set<ReportOptionEntity> entities) { Set<ReportOption> options = new HashSet<>(entities.size()); for (ReportOptionEntity entity : entities) { if (entity != null) { ReportOption option = transform(entity); options.add(option); } } return options; } Set<ReportOption... |
@Test public void should_list_report_options() throws Exception { reportOptionsUseCase.requestReportOptionsList(REPORT_URI); verify(mReportOptionMapper).transform(anySetOf(ReportOptionEntity.class)); verify(mReportOptionRestApi).requestReportOptionsList(REPORT_URI); } | public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catc... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... |
@Test public void list_report_options_adapts_io_exception() throws Exception { when(mReportOptionRestApi.requestReportOptionsList(anyString())).thenThrow(mIOException); try { reportOptionsUseCase.requestReportOptionsList(REPORT_URI); fail("Should adapt IO exception"); } catch (ServiceException ex) { verify(mExceptionMa... | public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catc... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... |
@Test public void list_report_options_adapts_http_exception() throws Exception { when(mReportOptionRestApi.requestReportOptionsList(anyString())).thenThrow(mHttpException); try { reportOptionsUseCase.requestReportOptionsList(REPORT_URI); fail("Should adapt HTTP exception"); } catch (ServiceException ex) { verify(mExcep... | public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catc... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... | ReportOptionsUseCase { public Set<ReportOption> requestReportOptionsList(String reportUnitUri) throws ServiceException { try { Set<ReportOptionEntity> entities = mReportOptionRestApi.requestReportOptionsList(reportUnitUri); return mReportOptionMapper.transform(entities); } catch (HttpException e) { throw mExceptionMapp... |
@Test public void should_create_report_option() throws Exception { reportOptionsUseCase.createReportOption(REPORT_URI, OPTION_LABEL, REPORT_PARAMETERS, true); verify(mReportOptionMapper).transform(any(ReportOptionEntity.class)); verify(mReportOptionRestApi).createReportOption(REPORT_URI, OPTION_LABEL, REPORT_PARAMETERS... | public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptionMapper.transform(entit... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... |
@Test public void should_update_report_option() throws Exception { reportOptionsUseCase.updateReportOption(REPORT_URI, OPTION_ID, REPORT_PARAMETERS); verify(mReportOptionRestApi).updateReportOption(REPORT_URI, OPTION_ID, REPORT_PARAMETERS); } | public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... |
@Test public void runExportExecutionShouldThrowRestErrorOn500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.runExportExecution("any_id", ExecutionRequestOptions.create()); } | @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution options should not be null"... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... | ReportExportRestApi { @NotNull public ExportExecutionDescriptor runExportExecution(@NotNull String executionId, @NotNull ExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(executionOptions, "Execution optio... |
@Test public void should_delete_report_option() throws Exception { reportOptionsUseCase.deleteReportOption(REPORT_URI, OPTION_LABEL); verify(mReportOptionRestApi).deleteReportOption(REPORT_URI, OPTION_ID); } | public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } } | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } Repor... | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } Repor... | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } Repor... |
@Test public void create_report_option_adapts_io_exception() throws Exception { when(mReportOptionRestApi.createReportOption(anyString(), anyString(), anyListOf(ReportParameter.class), anyBoolean())).thenThrow(mIOException); try { reportOptionsUseCase.createReportOption(REPORT_URI, OPTION_LABEL, REPORT_PARAMETERS, true... | public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptionMapper.transform(entit... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... |
@Test public void create_report_option_adapts_http_exception() throws Exception { when(mReportOptionRestApi.createReportOption(anyString(), anyString(), anyListOf(ReportParameter.class), anyBoolean())).thenThrow(mHttpException); try { reportOptionsUseCase.createReportOption(REPORT_URI, OPTION_LABEL, REPORT_PARAMETERS, ... | public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptionMapper.transform(entit... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... | ReportOptionsUseCase { public ReportOption createReportOption(String reportUri, String optionLabel, List<ReportParameter> parameters, boolean overwrite) throws ServiceException { try { ReportOptionEntity entity = mReportOptionRestApi.createReportOption(reportUri, optionLabel, parameters, overwrite); return mReportOptio... |
@Test public void update_report_option_adapts_io_exception() throws Exception { doThrow(mIOException).when(mReportOptionRestApi).updateReportOption(anyString(), anyString(), anyListOf(ReportParameter.class)); try { reportOptionsUseCase.updateReportOption(REPORT_URI, OPTION_LABEL, REPORT_PARAMETERS); fail("Should adapt ... | public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... |
@Test public void update_report_option_adapts_http_exception() throws Exception { doThrow(mHttpException).when(mReportOptionRestApi).updateReportOption(anyString(), anyString(), anyListOf(ReportParameter.class)); try { reportOptionsUseCase.updateReportOption(REPORT_URI, OPTION_LABEL, REPORT_PARAMETERS); fail("Should ad... | public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... | ReportOptionsUseCase { public void updateReportOption(String reportUri, String optionId, List<ReportParameter> parameters) throws ServiceException { try { mReportOptionRestApi.updateReportOption(reportUri, optionId, parameters); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { ... |
@Test public void delete_report_option_adapts_io_exception() throws Exception { doThrow(mIOException).when(mReportOptionRestApi).deleteReportOption(anyString(), anyString()); try { reportOptionsUseCase.deleteReportOption(REPORT_URI, OPTION_LABEL); fail("Should adapt IO exception"); } catch (ServiceException ex) { verif... | public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } } | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } Repor... | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } Repor... | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } Repor... |
@Test public void delete_report_option_adapts_http_exception() throws Exception { doThrow(mHttpException).when(mReportOptionRestApi).deleteReportOption(anyString(), anyString()); try { reportOptionsUseCase.deleteReportOption(REPORT_URI, OPTION_LABEL); fail("Should adapt HTTP exception"); } catch (ServiceException ex) {... | public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } } | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } Repor... | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } Repor... | ReportOptionsUseCase { public void deleteReportOption(String reportUri, String optionId) throws ServiceException { try { mReportOptionRestApi.deleteReportOption(reportUri, optionId); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transform(e); } } Repor... |
@Test public void should_request_controls() throws Exception { mReportControlsUseCase.requestControls(REPORT_URI, null, false); verify(mRestApi).requestInputControls(REPORT_URI, null, false); } | public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transfo... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... |
@Test public void should_request_resource_values() throws Exception { mReportControlsUseCase.requestResourceValues(REPORT_URI, false); verify(mRestApi).requestInputControlsInitialStates(REPORT_URI, false); } | public List<InputControlState> requestResourceValues(String resourceUri, boolean freshData) throws ServiceException { try { return mRestApi.requestInputControlsInitialStates(resourceUri, freshData); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transfo... | ReportControlsUseCase { public List<InputControlState> requestResourceValues(String resourceUri, boolean freshData) throws ServiceException { try { return mRestApi.requestInputControlsInitialStates(resourceUri, freshData); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControlState> requestResourceValues(String resourceUri, boolean freshData) throws ServiceException { try { return mRestApi.requestInputControlsInitialStates(resourceUri, freshData); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControlState> requestResourceValues(String resourceUri, boolean freshData) throws ServiceException { try { return mRestApi.requestInputControlsInitialStates(resourceUri, freshData); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControlState> requestResourceValues(String resourceUri, boolean freshData) throws ServiceException { try { return mRestApi.requestInputControlsInitialStates(resourceUri, freshData); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... |
@Test public void request_controls_adapt_io_exception() throws Exception { when(mRestApi.requestInputControls(anyString(), anySetOf(String.class), anyBoolean())).thenThrow(mIOException); try { mReportControlsUseCase.requestControls(REPORT_URI, null, false); fail("Should adapt IO exception"); } catch (ServiceException e... | public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transfo... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... |
@Test public void checkExportExecutionStatusShouldThrowRestErrorOn500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.checkExportExecutionStatus("any_id", "any_id"); } | @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new PathResolver.Builder()... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... |
@Test public void request_controls_adapt_http_exception() throws Exception { when(mRestApi.requestInputControls(anyString(), anySetOf(String.class), anyBoolean())).thenThrow(mHttpException); try { mReportControlsUseCase.requestControls(REPORT_URI, null, false); fail("Should adapt HTTP exception"); } catch (ServiceExcep... | public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw mExceptionMapper.transfo... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... | ReportControlsUseCase { public List<InputControl> requestControls(String reportUri, Set<String> ids, boolean excludeState) throws ServiceException { try { return mRestApi.requestInputControls(reportUri, ids, excludeState); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { throw ... |
@Test public void request_controls_values_adapt_io_exception() throws Exception { when(mRestApi.requestInputControlsStates(anyString(), anyListOf(ReportParameter.class), anyBoolean())).thenThrow(mIOException); try { mReportControlsUseCase.requestControlsValues(REPORT_URI, PARAMS, false); fail("Should adapt IO exception... | public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { thr... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... |
@Test public void request_controls_values_adapt_http_exception() throws Exception { when(mRestApi.requestInputControlsStates(anyString(), anyListOf(ReportParameter.class), anyBoolean())).thenThrow(mHttpException); try { mReportControlsUseCase.requestControlsValues(REPORT_URI, PARAMS, false); fail("Should adapt HTTP exc... | public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { thr... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... |
@Test public void should_request_controls_values() throws Exception { mReportControlsUseCase.requestControlsValues(REPORT_URI, PARAMS, false); verify(mRestApi).requestInputControlsStates(REPORT_URI, PARAMS, false); } | public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } catch (IOException e) { thr... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... | ReportControlsUseCase { public List<InputControlState> requestControlsValues(String reportUri, List<ReportParameter> parameters, boolean fresh) throws ServiceException { try { return mRestApi.requestInputControlsStates(reportUri, parameters, fresh); } catch (HttpException e) { throw mExceptionMapper.transform(e); } cat... |
@Test public void shouldTransform() { ServerInfo info = transformerUnderTest.transform(mServerInfoData); assertThat(info.getBuild(), is("20150527_1447")); assertThat(info.getDateFormatPattern(), is(new SimpleDateFormat("yyyy-MM-dd"))); assertThat(info.getDatetimeFormatPattern(), is(new SimpleDateFormat("yyyy-MM-dd'T'HH... | public ServerInfo transform(ServerInfoData response) { ServerInfo serverInfo = new ServerInfo(); serverInfo.setBuild(response.getBuild()); SimpleDateFormat dateDateFormat = new SimpleDateFormat(response.getDateFormatPattern()); serverInfo.setDateFormatPattern(dateDateFormat); SimpleDateFormat dateTimeFormat = new Simpl... | ServerInfoTransformer { public ServerInfo transform(ServerInfoData response) { ServerInfo serverInfo = new ServerInfo(); serverInfo.setBuild(response.getBuild()); SimpleDateFormat dateDateFormat = new SimpleDateFormat(response.getDateFormatPattern()); serverInfo.setDateFormatPattern(dateDateFormat); SimpleDateFormat da... | ServerInfoTransformer { public ServerInfo transform(ServerInfoData response) { ServerInfo serverInfo = new ServerInfo(); serverInfo.setBuild(response.getBuild()); SimpleDateFormat dateDateFormat = new SimpleDateFormat(response.getDateFormatPattern()); serverInfo.setDateFormatPattern(dateDateFormat); SimpleDateFormat da... | ServerInfoTransformer { public ServerInfo transform(ServerInfoData response) { ServerInfo serverInfo = new ServerInfo(); serverInfo.setBuild(response.getBuild()); SimpleDateFormat dateDateFormat = new SimpleDateFormat(response.getDateFormatPattern()); serverInfo.setDateFormatPattern(dateDateFormat); SimpleDateFormat da... | ServerInfoTransformer { public ServerInfo transform(ServerInfoData response) { ServerInfo serverInfo = new ServerInfo(); serverInfo.setBuild(response.getBuild()); SimpleDateFormat dateDateFormat = new SimpleDateFormat(response.getDateFormatPattern()); serverInfo.setDateFormatPattern(dateDateFormat); SimpleDateFormat da... |
@Test public void should_map_file_lookup() throws Exception { mockFileLookup(); FileResource resource = mapper.transform(mFileLookup); assertThat(resource.getType(), is(FileResource.Type.pdf)); } | @Override public FileResource transform(FileLookup lookup) { FileResource.Builder builder = new FileResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder, lookup); FileResource.Type type = FileResource.Type.valueOf(lookup.getType()); builder.wit... | FileResourceMapper extends AbstractResourceMapper<FileResource, FileLookup> { @Override public FileResource transform(FileLookup lookup) { FileResource.Builder builder = new FileResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder, lookup); Fil... | FileResourceMapper extends AbstractResourceMapper<FileResource, FileLookup> { @Override public FileResource transform(FileLookup lookup) { FileResource.Builder builder = new FileResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder, lookup); Fil... | FileResourceMapper extends AbstractResourceMapper<FileResource, FileLookup> { @Override public FileResource transform(FileLookup lookup) { FileResource.Builder builder = new FileResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder, lookup); Fil... | FileResourceMapper extends AbstractResourceMapper<FileResource, FileLookup> { @Override public FileResource transform(FileLookup lookup) { FileResource.Builder builder = new FileResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder, lookup); Fil... |
@Test public void shouldNotAcceptNegativeOffset() { mExpectedException.expect(IllegalArgumentException.class); mExpectedException.expectMessage("Offset should be positive"); RepositorySearchCriteria.builder().withOffset(-1).build(); } | @NotNull public static Builder builder() { return new Builder(); } | RepositorySearchCriteria { @NotNull public static Builder builder() { return new Builder(); } } | RepositorySearchCriteria { @NotNull public static Builder builder() { return new Builder(); } private RepositorySearchCriteria(Builder builder); } | RepositorySearchCriteria { @NotNull public static Builder builder() { return new Builder(); } private RepositorySearchCriteria(Builder builder); @NotNull static Builder builder(); @NotNull static RepositorySearchCriteria empty(); int getLimit(); int getOffset(); @Nullable String getQuery(); @Nullable Boolean getRecurs... | RepositorySearchCriteria { @NotNull public static Builder builder() { return new Builder(); } private RepositorySearchCriteria(Builder builder); @NotNull static Builder builder(); @NotNull static RepositorySearchCriteria empty(); int getLimit(); int getOffset(); @Nullable String getQuery(); @Nullable Boolean getRecurs... |
@Test public void shouldNotAcceptNegativeLimit() { mExpectedException.expect(IllegalArgumentException.class); mExpectedException.expectMessage("Limit should be positive"); RepositorySearchCriteria.builder().withLimit(-1).build(); } | @NotNull public static Builder builder() { return new Builder(); } | RepositorySearchCriteria { @NotNull public static Builder builder() { return new Builder(); } } | RepositorySearchCriteria { @NotNull public static Builder builder() { return new Builder(); } private RepositorySearchCriteria(Builder builder); } | RepositorySearchCriteria { @NotNull public static Builder builder() { return new Builder(); } private RepositorySearchCriteria(Builder builder); @NotNull static Builder builder(); @NotNull static RepositorySearchCriteria empty(); int getLimit(); int getOffset(); @Nullable String getQuery(); @Nullable Boolean getRecurs... | RepositorySearchCriteria { @NotNull public static Builder builder() { return new Builder(); } private RepositorySearchCriteria(Builder builder); @NotNull static Builder builder(); @NotNull static RepositorySearchCriteria empty(); int getLimit(); int getOffset(); @Nullable String getQuery(); @Nullable Boolean getRecurs... |
@Test public void should_map_file_lookup() throws Exception { mockFileLookup(); ReportResource resource = mapper.transform(mReportLookup); assertThat(resource.alwaysPromptControls(), is(true)); } | @Override public ReportResource transform(ReportLookup lookup) { ReportResource.Builder builder = new ReportResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder, lookup); builder.withAlwaysPrompt(lookup.alwaysPromptControls()); return builder.b... | ReportResourceMapper extends AbstractResourceMapper<ReportResource, ReportLookup> { @Override public ReportResource transform(ReportLookup lookup) { ReportResource.Builder builder = new ReportResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder... | ReportResourceMapper extends AbstractResourceMapper<ReportResource, ReportLookup> { @Override public ReportResource transform(ReportLookup lookup) { ReportResource.Builder builder = new ReportResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder... | ReportResourceMapper extends AbstractResourceMapper<ReportResource, ReportLookup> { @Override public ReportResource transform(ReportLookup lookup) { ReportResource.Builder builder = new ReportResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder... | ReportResourceMapper extends AbstractResourceMapper<ReportResource, ReportLookup> { @Override public ReportResource transform(ReportLookup lookup) { ReportResource.Builder builder = new ReportResource.Builder(); AbstractResourceBuilder abstractResourceBuilder = builder.addResource(); buildLookup(abstractResourceBuilder... |
@Test public void should_map_lookup_to_resource() throws Exception { long creationTime = TestConstants.DATE_TIME_FORMAT.parse("2013-10-03 16:32:05").getTime(); long updateTime = TestConstants.DATE_TIME_FORMAT.parse("2013-11-03 16:32:05").getTime(); Resource resource = mMapper.transform(mResourceLookup); assertThat(reso... | @Override public Resource transform(ResourceLookup lookup) { AbstractResourceBuilder<?> builder = new AbstractResourceBuilder<>(null); buildLookup(builder, lookup); return builder.getResourceBuilder().build(); } | ResourceMapper extends AbstractResourceMapper<Resource, ResourceLookup> { @Override public Resource transform(ResourceLookup lookup) { AbstractResourceBuilder<?> builder = new AbstractResourceBuilder<>(null); buildLookup(builder, lookup); return builder.getResourceBuilder().build(); } } | ResourceMapper extends AbstractResourceMapper<Resource, ResourceLookup> { @Override public Resource transform(ResourceLookup lookup) { AbstractResourceBuilder<?> builder = new AbstractResourceBuilder<>(null); buildLookup(builder, lookup); return builder.getResourceBuilder().build(); } ResourceMapper(@NotNull SimpleDate... | ResourceMapper extends AbstractResourceMapper<Resource, ResourceLookup> { @Override public Resource transform(ResourceLookup lookup) { AbstractResourceBuilder<?> builder = new AbstractResourceBuilder<>(null); buildLookup(builder, lookup); return builder.getResourceBuilder().build(); } ResourceMapper(@NotNull SimpleDate... | ResourceMapper extends AbstractResourceMapper<Resource, ResourceLookup> { @Override public Resource transform(ResourceLookup lookup) { AbstractResourceBuilder<?> builder = new AbstractResourceBuilder<>(null); buildLookup(builder, lookup); return builder.getResourceBuilder().build(); } ResourceMapper(@NotNull SimpleDate... |
@Test public void requestExportOutputShouldThrowRestErrorOn500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.requestExportOutput("any_id", "any_id"); } | @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new PathResolver.Builder() .... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... |
@Test public void shouldMakeImmediateCallOnApiForUserOffsetZero() throws Exception { InternalCriteria searchCriteria = new InternalCriteria.Builder().offset(0).create(); RepositorySearchTask strategy = new RepositorySearchTaskV5_6Plus(searchCriteria, mSearchUseCase); strategy.nextLookup(); InternalCriteria internalCrit... | @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(performLookup()); } | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... |
@Test public void makesAdditionalCallOnApiIfUserOffsetNotZero() throws Exception { InternalCriteria searchCriteria = new InternalCriteria.Builder().offset(5).create(); RepositorySearchTask strategy = new RepositorySearchTaskV5_6Plus(searchCriteria, mSearchUseCase); strategy.nextLookup(); InternalCriteria internalCriter... | @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(performLookup()); } | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... |
@Test public void secondSearchLookupShouldUseNextOffset() throws Exception { InternalCriteria searchCriteria = new InternalCriteria.Builder().offset(0).create(); RepositorySearchTask strategy = new RepositorySearchTaskV5_6Plus(searchCriteria, mSearchUseCase); when(mResponse.getNextOffset()).thenReturn(133); strategy.ne... | @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(performLookup()); } | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... | RepositorySearchTaskV5_6Plus extends RepositorySearchTask { @NotNull @Override public List<Resource> nextLookup() throws ServiceException { if (mEndReached || mInitialCriteria.getLimit() == 0){ return EMPTY_RESPONSE; } if (mInternalOffset == UNDEFINED) { defineInternalOffset(); } return Collections.unmodifiableList(per... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.