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 logWarning() { LoggingSystem.get(ClassLoader.getSystemClassLoader()) .setLogLevel(org.slf4j.Logger.ROOT_LOGGER_NAME, LogLevel.WARN); logger.log(LogLevel.WARN, "logger name", "warn message"); assertThat(capture.toString(), containsString("WARN logger name - warn message")); }
private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); break; ca...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
@Test public void logWarningError() { LoggingSystem.get(ClassLoader.getSystemClassLoader()) .setLogLevel(org.slf4j.Logger.ROOT_LOGGER_NAME, LogLevel.WARN); logger.log(LogLevel.WARN, "logger name", "warn message", new Exception("error message")); Pattern pattern = Pattern.compile("WARN logger name - warn message.*java.l...
private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); break; ca...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
@Test public void logError() { LoggingSystem.get(ClassLoader.getSystemClassLoader()) .setLogLevel(org.slf4j.Logger.ROOT_LOGGER_NAME, LogLevel.ERROR); logger.log(LogLevel.ERROR, "logger name", "error message"); assertThat(capture.toString(), containsString("ERROR logger name - error message")); }
private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); break; ca...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
@Test public void logErrorError() { LoggingSystem.get(ClassLoader.getSystemClassLoader()) .setLogLevel(org.slf4j.Logger.ROOT_LOGGER_NAME, LogLevel.ERROR); logger.log(LogLevel.ERROR, "logger name", "error message", new Exception("error message")); Pattern pattern = Pattern.compile("ERROR logger name - error message.*jav...
private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); break; ca...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
Logger { private void log(org.slf4j.Logger logger, LogLevel level, String message) { Objects.requireNonNull(level, "LogLevel must not be null."); switch (level) { case TRACE: logger.trace(message); break; case DEBUG: logger.debug(message); break; case INFO: logger.info(message); break; case WARN: logger.warn(message); ...
@Test public void testRelativeRedirects() throws Throwable { try (DeferredAssertions as = new DeferredAssertions()) { client.get().setURL("http: @Override public void receive(final State<?> object) { if (object.stateType() == StateType.Redirect) { as.add(new Assertion() { @Override public void exec() throws Throwable {...
public HttpRequestBuilder get() { return new RB(Method.GET); }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
@Test public void testRedirectLimit() throws Throwable { final List<URL> redirects = new CopyOnWriteArrayList<>(); final Set<StateType> states = Sets.newConcurrentHashSet(); final AtomicBoolean errorResponse = new AtomicBoolean(); final AtomicReference<Throwable> error = new AtomicReference<>(); final AtomicBoolean rec...
public HttpRequestBuilder get() { return new RB(Method.GET); }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
@Test(expected = InvalidInputException.class) public void testInvalidUrl() throws Throwable { client.get().setURL(URL.parse("!garbage!!")).execute(); }
public HttpRequestBuilder get() { return new RB(Method.GET); }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
@Test public void testCancellation() throws Throwable { final CountDownLatch latch = new CountDownLatch(2); final AtomicReference<ResponseFuture> future = new AtomicReference<>(); final AtomicReference<Throwable> exception = new AtomicReference<>(); final AtomicBoolean cancelled = new AtomicBoolean(); final AtomicBoole...
public HttpRequestBuilder get() { return new RB(Method.GET); }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
@Test public void testPost() throws Throwable { final AM am = new AM(); final String ur = "http: client.addActivityMonitor(am); final DeferredAssertions assertions = new DeferredAssertions(); final Set<StateType> stateTypes = new HashSet<>(); final String[] xheader = new String[1]; ResponseFuture f = client.post() .set...
public HttpRequestBuilder post() { return new RB(Method.POST); }
HttpClient { public HttpRequestBuilder post() { return new RB(Method.POST); } }
HttpClient { public HttpRequestBuilder post() { return new RB(Method.POST); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder post() { return new RB(Method.POST); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder post() { return new RB(Method.POST); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
@Test public void test() throws Throwable { final CookieStore store = new CookieStore(); final String[] contents = new String[1]; ResponseFuture h = client.get().setCookieStore(store).setURL(URL.parse("https: .execute(new ResponseHandler<String>(String.class) { @Override protected void receive(HttpResponseStatus status...
public HttpRequestBuilder get() { return new RB(Method.GET); }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } }
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
HttpClient { public HttpRequestBuilder get() { return new RB(Method.GET); } HttpClient(); HttpClient(boolean compress, int maxChunkSize, int threads, int maxInitialLineLength, int maxHeadersSize, boolean followRedirects, CharSequence userAgent, List<RequestInterceptor> interceptors, ...
@Test public void shouldSetDataSourceOnInit() { plugin.init(application); verify(flyway).setDataSource("jdbc:mysql: verify(flyway).setSchemas("test"); }
public void init(Application<? extends ApplicationConfiguration> application) { DatabaseConfiguration dbConfig = application.getConfiguration().getDatabaseConfiguration(); URI uri = getUri(dbConfig.getUrl()); if (Strings.isNullOrEmpty(uri.getPath())) { flyway.setDataSource(dbConfig.getUrl(), dbConfig.getUsername(), dbC...
MigrationsPlugin implements Plugin { public void init(Application<? extends ApplicationConfiguration> application) { DatabaseConfiguration dbConfig = application.getConfiguration().getDatabaseConfiguration(); URI uri = getUri(dbConfig.getUrl()); if (Strings.isNullOrEmpty(uri.getPath())) { flyway.setDataSource(dbConfig....
MigrationsPlugin implements Plugin { public void init(Application<? extends ApplicationConfiguration> application) { DatabaseConfiguration dbConfig = application.getConfiguration().getDatabaseConfiguration(); URI uri = getUri(dbConfig.getUrl()); if (Strings.isNullOrEmpty(uri.getPath())) { flyway.setDataSource(dbConfig....
MigrationsPlugin implements Plugin { public void init(Application<? extends ApplicationConfiguration> application) { DatabaseConfiguration dbConfig = application.getConfiguration().getDatabaseConfiguration(); URI uri = getUri(dbConfig.getUrl()); if (Strings.isNullOrEmpty(uri.getPath())) { flyway.setDataSource(dbConfig....
MigrationsPlugin implements Plugin { public void init(Application<? extends ApplicationConfiguration> application) { DatabaseConfiguration dbConfig = application.getConfiguration().getDatabaseConfiguration(); URI uri = getUri(dbConfig.getUrl()); if (Strings.isNullOrEmpty(uri.getPath())) { flyway.setDataSource(dbConfig....
@Test public void shouldSetEntityKeyOnMetaDataWhenOnMethod() throws Exception { Method method = DummyModel.class.getDeclaredMethod("getCode"); handler.handle(metaData, key, method); verify(metaData).setEntityKey("code"); }
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); }
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } }
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } }
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void h...
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void h...
@Test public void shouldSetEntityKeyOnMetaDataWhenOnField() throws Exception { Field field = DummyModel.class.getDeclaredField("code"); handler.handle(metaData, key, field); verify(metaData).setEntityKey("code"); }
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); }
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } }
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } }
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void h...
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void h...
@Test(expectedExceptions=IllegalArgumentException.class, expectedExceptionsMessageRegExp="Method - readCode is not a getter") public void shouldThrowExceptionWhenMethodIsNotGetter() throws Exception { Method method = DummyModel.class.getDeclaredMethod("readCode"); handler.handle(metaData, key, method); }
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); }
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } }
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } }
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void h...
EntityKeyAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { metaData.setEntityKey(getGetterName(method, true)); } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void h...
@Test public void shouldHandleSecureAnnotation() { SecurableMetaData metaData = mock(SecurableMetaData.class); SecureMultipleAnnotationHandler handler = new SecureMultipleAnnotationHandler(); SecureMultiple multiple = mock(SecureMultiple.class); Secure secure1 = mock(Secure.class); when(secure1.permissions()).thenRetur...
public void handle(SecurableMetaData metaData, Annotation annotation) { for (Secure secure : ((SecureMultiple) annotation).value()) { super.handle(metaData, secure); } }
SecureMultipleAnnotationHandler extends SecureAnnotationHandler { public void handle(SecurableMetaData metaData, Annotation annotation) { for (Secure secure : ((SecureMultiple) annotation).value()) { super.handle(metaData, secure); } } }
SecureMultipleAnnotationHandler extends SecureAnnotationHandler { public void handle(SecurableMetaData metaData, Annotation annotation) { for (Secure secure : ((SecureMultiple) annotation).value()) { super.handle(metaData, secure); } } }
SecureMultipleAnnotationHandler extends SecureAnnotationHandler { public void handle(SecurableMetaData metaData, Annotation annotation) { for (Secure secure : ((SecureMultiple) annotation).value()) { super.handle(metaData, secure); } } void handle(SecurableMetaData metaData, Annotation annotation); }
SecureMultipleAnnotationHandler extends SecureAnnotationHandler { public void handle(SecurableMetaData metaData, Annotation annotation) { for (Secure secure : ((SecureMultiple) annotation).value()) { super.handle(metaData, secure); } } void handle(SecurableMetaData metaData, Annotation annotation); }
@Test public void shouldGetAnnotationType() { assertEquals(handler.getAnnotationType(), ManyToMany.class); }
@Override public Class<?> getAnnotationType() { return ManyToMany.class; }
ManyToManyAnnotationHandler extends OneToManyAnnotationHandler { @Override public Class<?> getAnnotationType() { return ManyToMany.class; } }
ManyToManyAnnotationHandler extends OneToManyAnnotationHandler { @Override public Class<?> getAnnotationType() { return ManyToMany.class; } }
ManyToManyAnnotationHandler extends OneToManyAnnotationHandler { @Override public Class<?> getAnnotationType() { return ManyToMany.class; } @Override Class<?> getAnnotationType(); }
ManyToManyAnnotationHandler extends OneToManyAnnotationHandler { @Override public Class<?> getAnnotationType() { return ManyToMany.class; } @Override Class<?> getAnnotationType(); }
@Test public void shouldGetAnnotationType() { assertEquals(handler.getAnnotationType(), Action.class); }
@Override public Class<?> getAnnotationType() { return Action.class; }
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return Action.class; } }
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return Action.class; } }
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return Action.class; } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void handle(EntityMetaData metaData, Annotation annotation, Field field); @Override Cl...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return Action.class; } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void handle(EntityMetaData metaData, Annotation annotation, Field field); @Override Cl...
@Test public void shouldAddActionMethodToMetadataWhenOnMethod() throws Exception { Method method = DummyModel.class.getDeclaredMethod("dummyAction"); handler.handle(metaData, annotation, method); ActionMetaData data = new ActionMetaData("dummyAction", "/dummy", method); verify(metaData).addActionMethod(data); }
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateRoot. {} class is not an aggregate root", metaData.getEntityClass()...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
@Test public void shouldAddActionMethodWithCustomValueToMetadataWhenOnMethod() throws Exception { when(annotation.value()).thenReturn("customAction"); Method method = DummyModel.class.getDeclaredMethod("dummyAction"); handler.handle(metaData, annotation, method); ActionMetaData data = new ActionMetaData("customAction",...
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateRoot. {} class is not an aggregate root", metaData.getEntityClass()...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
@Test public void shouldAddActionMethodToMetadataWithParamsWhenOnMethod() throws Exception { Method method = DummyModel.class.getDeclaredMethod("dummyAction", String.class, Long.class); handler.handle(metaData, annotation, method); ActionMetaData data = new ActionMetaData("dummyAction", "/dummy", method); data.addParam...
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateRoot. {} class is not an aggregate root", metaData.getEntityClass()...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
@Test(expectedExceptions=IllegalArgumentException.class) public void shouldNotAddActionToMetadataWhenOnField() throws Exception { Field field = DummyModel.class.getDeclaredField("children"); handler.handle(metaData, annotation, field); }
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateRoot. {} class is not an aggregate root", metaData.getEntityClass()...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
@Test public void shouldGetClientFromSessionIfClientNameAttributeIsSet() { Session session = mock(Session.class); when(session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER)).thenReturn("client1"); assertEquals(filter.getClient(session), basicClient); }
protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClient(clientName); }
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
@Test(expectedExceptions=MinnalInstrumentationException.class) public void shouldThrowExceptionWhenActionSpecifiedOnNonAggregateRoot() throws Exception { when(metaData.getEntityClass()).thenReturn((Class) NonAggregateRootModel.class); Method method = NonAggregateRootModel.class.getDeclaredMethod("dummyAction"); handler...
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateRoot. {} class is not an aggregate root", metaData.getEntityClass()...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
ActionAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { if (! ClassUtils.hasAnnotation(metaData.getEntityClass(), AggregateRoot.class)) { logger.error("@Action can be specified only on classes marked with @AggregateR...
@Test public void shouldGetAnnotationType() { assertEquals(handler.getAnnotationType(), Searchable.class); }
@Override public Class<?> getAnnotationType() { return Searchable.class; }
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return Searchable.class; } }
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return Searchable.class; } }
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return Searchable.class; } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void handle(EntityMetaData metaData, Annotation annotation, Field field); @Ove...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return Searchable.class; } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void handle(EntityMetaData metaData, Annotation annotation, Field field); @Ove...
@Test public void shouldAddSearchFieldToMetadataWhenOnMethod() throws Exception { Method method = DummyModel.class.getDeclaredMethod("getCode"); handler.handle(metaData, annotation, method); ParameterMetaData data = new ParameterMetaData("code", "code", String.class); metaData.addSearchField(data); }
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMetaData = new ParameterMetaData(value, value, method.getReturnType()); me...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
@Test public void shouldAddSearchFieldWithValueToMetadataWhenOnMethod() throws Exception { when(annotation.value()).thenReturn("customCode"); Method method = DummyModel.class.getDeclaredMethod("getCode"); handler.handle(metaData, annotation, method); ParameterMetaData data = new ParameterMetaData("customCode", "code", ...
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMetaData = new ParameterMetaData(value, value, method.getReturnType()); me...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
@Test public void shouldAddSearchFieldToMetadataWhenOnField() throws Exception { Field field = DummyModel.class.getDeclaredField("code"); handler.handle(metaData, annotation, field); ParameterMetaData data = new ParameterMetaData("code", "code", String.class); metaData.addSearchField(data); }
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMetaData = new ParameterMetaData(value, value, method.getReturnType()); me...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
@Test public void shouldAddSearchFieldWithValueToMetadataWhenOnField() throws Exception { when(annotation.value()).thenReturn("customCode"); Field field = DummyModel.class.getDeclaredField("code"); handler.handle(metaData, annotation, field); ParameterMetaData data = new ParameterMetaData("customCode", "code", String.c...
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMetaData = new ParameterMetaData(value, value, method.getReturnType()); me...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
SearchableAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { String value = ((Searchable)annotation).value(); value = Strings.isNullOrEmpty(value) ? getGetterName(method, true) : value; ParameterMetaData parameterMeta...
@Test public void shouldGetAnnotationType() { assertEquals(handler.getAnnotationType(), OneToOne.class); }
@Override public Class<?> getAnnotationType() { return OneToOne.class; }
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return OneToOne.class; } }
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return OneToOne.class; } }
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return OneToOne.class; } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void handle(EntityMetaData metaData, Annotation annotation, Field field); @Overrid...
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public Class<?> getAnnotationType() { return OneToOne.class; } @Override void handle(EntityMetaData metaData, Annotation annotation, Method method); @Override void handle(EntityMetaData metaData, Annotation annotation, Field field); @Overrid...
@Test public void shouldAddToMetadataAssociationWhenOnMethod() throws Exception { Method method = DummyModel.class.getDeclaredMethod("getSpouse"); handler.handle(metaData, annotation, method); AssociationMetaData data = new AssociationMetaData("spouse", DummyModel.class, true); verify(metaData).addAssociation(data); }
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); metaData.addAssociation(associationMetaData); }
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); met...
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); met...
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); met...
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); met...
@Test public void shouldAddToMetadataAssociationWhenOnField() throws Exception { Field field = DummyModel.class.getDeclaredField("spouse"); handler.handle(metaData, annotation, field); AssociationMetaData data = new AssociationMetaData("spouse", DummyModel.class, true); verify(metaData).addAssociation(data); }
@Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); metaData.addAssociation(associationMetaData); }
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); met...
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); met...
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); met...
OneToOneAnnotationHandler extends AbstractEntityAnnotationHandler { @Override public void handle(EntityMetaData metaData, Annotation annotation, Method method) { AssociationMetaData associationMetaData = new AssociationMetaData(getGetterName(method, false), method.getReturnType(), isEntity(method.getReturnType())); met...
@Test public void shouldHandleSecureAnnotation() { SecurableMetaData metaData = mock(SecurableMetaData.class); SecureAnnotationHandler handler = new SecureAnnotationHandler(); Secure secure = mock(Secure.class); when(secure.permissions()).thenReturn(new String[] {"permission1", "permission2"}); when(secure.method()).th...
public void handle(SecurableMetaData metaData, Annotation annotation) { metaData.addPermissionMetaData(constructPermissionMetaData(annotation)); }
SecureAnnotationHandler { public void handle(SecurableMetaData metaData, Annotation annotation) { metaData.addPermissionMetaData(constructPermissionMetaData(annotation)); } }
SecureAnnotationHandler { public void handle(SecurableMetaData metaData, Annotation annotation) { metaData.addPermissionMetaData(constructPermissionMetaData(annotation)); } }
SecureAnnotationHandler { public void handle(SecurableMetaData metaData, Annotation annotation) { metaData.addPermissionMetaData(constructPermissionMetaData(annotation)); } void handle(SecurableMetaData metaData, Annotation annotation); }
SecureAnnotationHandler { public void handle(SecurableMetaData metaData, Annotation annotation) { metaData.addPermissionMetaData(constructPermissionMetaData(annotation)); } void handle(SecurableMetaData metaData, Annotation annotation); }
@Test public void shouldReturnNullClientFromSessionIfClientNameAttributeIsNotSet() { Session session = mock(Session.class); when(session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER)).thenReturn(null); assertNull(filter.getClient(session)); }
protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClient(clientName); }
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
@Test public void shouldGetAnnotationType() { assertEquals(handler.getAnnotationType(), ManyToOne.class); }
@Override public Class<?> getAnnotationType() { return ManyToOne.class; }
ManyToOneAnnotationHandler extends OneToOneAnnotationHandler { @Override public Class<?> getAnnotationType() { return ManyToOne.class; } }
ManyToOneAnnotationHandler extends OneToOneAnnotationHandler { @Override public Class<?> getAnnotationType() { return ManyToOne.class; } }
ManyToOneAnnotationHandler extends OneToOneAnnotationHandler { @Override public Class<?> getAnnotationType() { return ManyToOne.class; } @Override Class<?> getAnnotationType(); }
ManyToOneAnnotationHandler extends OneToOneAnnotationHandler { @Override public Class<?> getAnnotationType() { return ManyToOne.class; } @Override Class<?> getAnnotationType(); }
@Test public void shouldConstructEntityTree() { entityNode = new EntityNode(CompositeModel.class, namingStrategy); entityNode.construct(); assertEquals(entityNode.getChildren().size(), 2); }
public void construct() { LinkedList<EntityNode> queue = new LinkedList<EntityNode>(); queue.offer(this); while (! queue.isEmpty()) { EntityNode node = queue.poll(); for (CollectionMetaData collection : node.getValue().getCollections()) { if (! collection.isEntity()) { continue; } EntityNode child = new EntityNode(coll...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public void construct() { LinkedList<EntityNode> queue = new LinkedList<EntityNode>(); queue.offer(this); while (! queue.isEmpty()) { EntityNode node = queue.poll(); for (CollectionMetaData collection : node.getValue().getCollections()) { if (! colle...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public void construct() { LinkedList<EntityNode> queue = new LinkedList<EntityNode>(); queue.offer(this); while (! queue.isEmpty()) { EntityNode node = queue.poll(); for (CollectionMetaData collection : node.getValue().getCollections()) { if (! colle...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public void construct() { LinkedList<EntityNode> queue = new LinkedList<EntityNode>(); queue.offer(this); while (! queue.isEmpty()) { EntityNode node = queue.poll(); for (CollectionMetaData collection : node.getValue().getCollections()) { if (! colle...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public void construct() { LinkedList<EntityNode> queue = new LinkedList<EntityNode>(); queue.offer(this); while (! queue.isEmpty()) { EntityNode node = queue.poll(); for (CollectionMetaData collection : node.getValue().getCollections()) { if (! colle...
@Test public void shouldPopulateEntityNodeName() { entityNode = new EntityNode(CompositeModel.class, namingStrategy); assertEquals(entityNode.getName(), "compositeModel"); }
public String getName() { return name; }
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public String getName() { return name; } }
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public String getName() { return name; } EntityNode(Class<?> entityClass, NamingStrategy namingStrategy); EntityNode(Class<?> entityClass, String name, NamingStrategy namingStrategy); EntityNode(CollectionMetaData collection, NamingStrategy naming...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public String getName() { return name; } EntityNode(Class<?> entityClass, NamingStrategy namingStrategy); EntityNode(Class<?> entityClass, String name, NamingStrategy namingStrategy); EntityNode(CollectionMetaData collection, NamingStrategy naming...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public String getName() { return name; } EntityNode(Class<?> entityClass, NamingStrategy namingStrategy); EntityNode(Class<?> entityClass, String name, NamingStrategy namingStrategy); EntityNode(CollectionMetaData collection, NamingStrategy naming...
@Test public void shouldPopulateEntityResourceName() { entityNode = new EntityNode(CompositeModel.class, namingStrategy); assertEquals(entityNode.getResourceName(), "composite_models"); }
public String getResourceName() { return resourceName; }
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public String getResourceName() { return resourceName; } }
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public String getResourceName() { return resourceName; } EntityNode(Class<?> entityClass, NamingStrategy namingStrategy); EntityNode(Class<?> entityClass, String name, NamingStrategy namingStrategy); EntityNode(CollectionMetaData collection, Namin...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public String getResourceName() { return resourceName; } EntityNode(Class<?> entityClass, NamingStrategy namingStrategy); EntityNode(Class<?> entityClass, String name, NamingStrategy namingStrategy); EntityNode(CollectionMetaData collection, Namin...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public String getResourceName() { return resourceName; } EntityNode(Class<?> entityClass, NamingStrategy namingStrategy); EntityNode(Class<?> entityClass, String name, NamingStrategy namingStrategy); EntityNode(CollectionMetaData collection, Namin...
@Test public void shouldPopulateEntityMetaData() { entityNode = new EntityNode(Parent.class, namingStrategy); assertEquals(entityNode.getEntityMetaData(), EntityMetaDataProvider.instance().getEntityMetaData(Parent.class)); }
public EntityMetaData getEntityMetaData() { return getValue(); }
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public EntityMetaData getEntityMetaData() { return getValue(); } }
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public EntityMetaData getEntityMetaData() { return getValue(); } EntityNode(Class<?> entityClass, NamingStrategy namingStrategy); EntityNode(Class<?> entityClass, String name, NamingStrategy namingStrategy); EntityNode(CollectionMetaData collectio...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public EntityMetaData getEntityMetaData() { return getValue(); } EntityNode(Class<?> entityClass, NamingStrategy namingStrategy); EntityNode(Class<?> entityClass, String name, NamingStrategy namingStrategy); EntityNode(CollectionMetaData collectio...
EntityNode extends Node<EntityNode, EntityNodePath, EntityMetaData> { public EntityMetaData getEntityMetaData() { return getValue(); } EntityNode(Class<?> entityClass, NamingStrategy namingStrategy); EntityNode(Class<?> entityClass, String name, NamingStrategy namingStrategy); EntityNode(CollectionMetaData collectio...
@Test public void shouldCreateGeneratedClass() { wrapper = new ResourceWrapper(resource, entityClass); assertNotNull(wrapper.getGeneratedClass()); }
public CtClass getGeneratedClass() { return generatedClass; }
ResourceWrapper { public CtClass getGeneratedClass() { return generatedClass; } }
ResourceWrapper { public CtClass getGeneratedClass() { return generatedClass; } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); }
ResourceWrapper { public CtClass getGeneratedClass() { return generatedClass; } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
ResourceWrapper { public CtClass getGeneratedClass() { return generatedClass; } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
@Test public void shouldCreateResourceClassCreator() { wrapper = spy(new ResourceWrapper(resource, entityClass)); ResourceClassCreator creator = wrapper.getResourceClassCreator(); assertEquals(creator.getEntityClass(), entityClass); assertEquals(creator.getPath(), resource.getPath()); assertEquals(creator.getResource()...
protected ResourceClassCreator getResourceClassCreator() { return new ResourceClassCreator(resource, namingStrategy, entityClass, path); }
ResourceWrapper { protected ResourceClassCreator getResourceClassCreator() { return new ResourceClassCreator(resource, namingStrategy, entityClass, path); } }
ResourceWrapper { protected ResourceClassCreator getResourceClassCreator() { return new ResourceClassCreator(resource, namingStrategy, entityClass, path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); }
ResourceWrapper { protected ResourceClassCreator getResourceClassCreator() { return new ResourceClassCreator(resource, namingStrategy, entityClass, path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
ResourceWrapper { protected ResourceClassCreator getResourceClassCreator() { return new ResourceClassCreator(resource, namingStrategy, entityClass, path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
@Test public void shouldGetCreateMethodCreator() { wrapper = spy(new ResourceWrapper(resource, entityClass)); ResourcePath resourcePath = new ResourcePath(path, true, namingStrategy); CreateMethodCreator creator = wrapper.getCreateMethodCreator(resourcePath); assertMethodCreator(creator, resourcePath); }
protected CreateMethodCreator getCreateMethodCreator(ResourcePath path) { return new CreateMethodCreator(generatedClass, resource, path, this.path); }
ResourceWrapper { protected CreateMethodCreator getCreateMethodCreator(ResourcePath path) { return new CreateMethodCreator(generatedClass, resource, path, this.path); } }
ResourceWrapper { protected CreateMethodCreator getCreateMethodCreator(ResourcePath path) { return new CreateMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); }
ResourceWrapper { protected CreateMethodCreator getCreateMethodCreator(ResourcePath path) { return new CreateMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
ResourceWrapper { protected CreateMethodCreator getCreateMethodCreator(ResourcePath path) { return new CreateMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
@Test public void shouldGetReadMethodCreator() { wrapper = spy(new ResourceWrapper(resource, entityClass)); ResourcePath resourcePath = new ResourcePath(path, false, namingStrategy); ReadMethodCreator creator = wrapper.getReadMethodCreator(resourcePath); assertMethodCreator(creator, resourcePath); }
protected ReadMethodCreator getReadMethodCreator(ResourcePath path) { return new ReadMethodCreator(generatedClass, resource, path, this.path); }
ResourceWrapper { protected ReadMethodCreator getReadMethodCreator(ResourcePath path) { return new ReadMethodCreator(generatedClass, resource, path, this.path); } }
ResourceWrapper { protected ReadMethodCreator getReadMethodCreator(ResourcePath path) { return new ReadMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); }
ResourceWrapper { protected ReadMethodCreator getReadMethodCreator(ResourcePath path) { return new ReadMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
ResourceWrapper { protected ReadMethodCreator getReadMethodCreator(ResourcePath path) { return new ReadMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
@Test public void shouldGetActionMethodCreator() { wrapper = spy(new ResourceWrapper(resource, entityClass)); ResourcePath resourcePath = new ResourcePath(path, false, namingStrategy); ActionMetaData action = mock(ActionMetaData.class); ActionMethodCreator creator = wrapper.getActionMethodCreator(resourcePath, action);...
protected ActionMethodCreator getActionMethodCreator(ResourcePath path, ActionMetaData action) { return new ActionMethodCreator(generatedClass, resource, path, this.path, action); }
ResourceWrapper { protected ActionMethodCreator getActionMethodCreator(ResourcePath path, ActionMetaData action) { return new ActionMethodCreator(generatedClass, resource, path, this.path, action); } }
ResourceWrapper { protected ActionMethodCreator getActionMethodCreator(ResourcePath path, ActionMetaData action) { return new ActionMethodCreator(generatedClass, resource, path, this.path, action); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); }
ResourceWrapper { protected ActionMethodCreator getActionMethodCreator(ResourcePath path, ActionMetaData action) { return new ActionMethodCreator(generatedClass, resource, path, this.path, action); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); Ct...
ResourceWrapper { protected ActionMethodCreator getActionMethodCreator(ResourcePath path, ActionMetaData action) { return new ActionMethodCreator(generatedClass, resource, path, this.path, action); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); Ct...
@Test(expectedExceptions=TechnicalException.class) public void shouldThrowExceptionIfClientNameIsNotFoundInSession() { Session session = mock(Session.class); when(session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER)).thenReturn("unknownClient"); filter.getClient(session); }
protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClient(clientName); }
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { protected Client getClient(Session session) { String clientName = session.getAttribute(Clients.DEFAULT_CLIENT_NAME_PARAMETER); if (Strings.isNullOrEmpty(clientName)) { return null; } return clients.findClien...
@Test public void shouldGetDeleteMethodCreator() { wrapper = spy(new ResourceWrapper(resource, entityClass)); ResourcePath resourcePath = new ResourcePath(path, false, namingStrategy); DeleteMethodCreator creator = wrapper.getDeleteMethodCreator(resourcePath); assertMethodCreator(creator, resourcePath); }
protected DeleteMethodCreator getDeleteMethodCreator(ResourcePath path) { return new DeleteMethodCreator(generatedClass, resource, path, this.path); }
ResourceWrapper { protected DeleteMethodCreator getDeleteMethodCreator(ResourcePath path) { return new DeleteMethodCreator(generatedClass, resource, path, this.path); } }
ResourceWrapper { protected DeleteMethodCreator getDeleteMethodCreator(ResourcePath path) { return new DeleteMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); }
ResourceWrapper { protected DeleteMethodCreator getDeleteMethodCreator(ResourcePath path) { return new DeleteMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
ResourceWrapper { protected DeleteMethodCreator getDeleteMethodCreator(ResourcePath path) { return new DeleteMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
@Test public void shouldGetListMethodCreator() { wrapper = spy(new ResourceWrapper(resource, entityClass)); ResourcePath resourcePath = new ResourcePath(path, false, namingStrategy); ListMethodCreator creator = wrapper.getListMethodCreator(resourcePath); assertMethodCreator(creator, resourcePath); }
protected ListMethodCreator getListMethodCreator(ResourcePath path) { return new ListMethodCreator(generatedClass, resource, path, this.path); }
ResourceWrapper { protected ListMethodCreator getListMethodCreator(ResourcePath path) { return new ListMethodCreator(generatedClass, resource, path, this.path); } }
ResourceWrapper { protected ListMethodCreator getListMethodCreator(ResourcePath path) { return new ListMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); }
ResourceWrapper { protected ListMethodCreator getListMethodCreator(ResourcePath path) { return new ListMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
ResourceWrapper { protected ListMethodCreator getListMethodCreator(ResourcePath path) { return new ListMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
@Test public void shouldGetUpdateMethodCreator() { wrapper = spy(new ResourceWrapper(resource, entityClass)); ResourcePath resourcePath = new ResourcePath(path, false, namingStrategy); UpdateMethodCreator creator = wrapper.getUpdateMethodCreator(resourcePath); assertMethodCreator(creator, resourcePath); }
protected UpdateMethodCreator getUpdateMethodCreator(ResourcePath path) { return new UpdateMethodCreator(generatedClass, resource, path, this.path); }
ResourceWrapper { protected UpdateMethodCreator getUpdateMethodCreator(ResourcePath path) { return new UpdateMethodCreator(generatedClass, resource, path, this.path); } }
ResourceWrapper { protected UpdateMethodCreator getUpdateMethodCreator(ResourcePath path) { return new UpdateMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); }
ResourceWrapper { protected UpdateMethodCreator getUpdateMethodCreator(ResourcePath path) { return new UpdateMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
ResourceWrapper { protected UpdateMethodCreator getUpdateMethodCreator(ResourcePath path) { return new UpdateMethodCreator(generatedClass, resource, path, this.path); } ResourceWrapper(ResourceMetaData resource, Class<?> entityClass); void addPath(EntityNodePath path); Class<?> wrap(); CtClass getGeneratedClass(); }
@Test public void shouldGetAnnotationType() { assertEquals(handler.getAnnotationType(), Path.class); }
public Class<?> getAnnotationType() { return Path.class; }
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public Class<?> getAnnotationType() { return Path.class; } }
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public Class<?> getAnnotationType() { return Path.class; } }
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public Class<?> getAnnotationType() { return Path.class; } void handle(ResourceMetaData metaData, Annotation annotation, Method method); Class<?> getAnnotationType(); @Override void handle(ResourceMetaData metaData, Annotation annotation, Field field); ...
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public Class<?> getAnnotationType() { return Path.class; } void handle(ResourceMetaData metaData, Annotation annotation, Method method); Class<?> getAnnotationType(); @Override void handle(ResourceMetaData metaData, Annotation annotation, Field field); ...
@Test public void shouldAddSubResourceLocatorToResource() throws Exception { Path path = mock(Path.class); when(path.value()).thenReturn("/sub"); handler.handle(metaData, path, DummyResource.class.getMethod("subResource")); assertTrue(! metaData.getSubResources().isEmpty()); assertEquals(metaData.getSubResources().iter...
public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).value())); metaData.addSubResource(subResource); } }
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).v...
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).v...
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).v...
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).v...
@Test public void shouldNotAddSubResourceMethodToResource() throws Exception { Path path = mock(Path.class); when(path.value()).thenReturn("/sub1"); handler.handle(metaData, path, DummyResource.class.getMethod("methodWithHttpMethodAnnotation")); assertTrue(metaData.getSubResources().isEmpty()); }
public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).value())); metaData.addSubResource(subResource); } }
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).v...
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).v...
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).v...
PathAnnotationHandler extends AbstractResourceAnnotationHandler { public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { if (! hasHttpMethod(method)) { ResourceMetaData subResource = new ResourceMetaData(method.getReturnType(), HttpUtil.concatPaths(metaData.getPath(), ((Path)annotation).v...
@Test public void shouldHandleGETAnnotation() throws Exception { GETAnnotationHandler handler = new GETAnnotationHandler(); handler.handle(metaData, mock(GET.class), DummyResource.class.getMethod("get")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethods().iterator().next()...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandleGETAnnotationWithPath() throws Exception { GETAnnotationHandler handler = new GETAnnotationHandler(); handler.handle(metaData, mock(GET.class), DummyResource.class.getMethod("getWithPath")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethods().i...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandlePOSTAnnotation() throws Exception { POSTAnnotationHandler handler = new POSTAnnotationHandler(); handler.handle(metaData, mock(POST.class), DummyResource.class.getMethod("post")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethods().iterator().n...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandlePOSTAnnotationWithPath() throws Exception { POSTAnnotationHandler handler = new POSTAnnotationHandler(); handler.handle(metaData, mock(POST.class), DummyResource.class.getMethod("postWithPath")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethod...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldReturnNullProfileIfNotFoundInSession() { Session session = mock(Session.class); when(session.getAttribute(AuthenticationFilter.PRINCIPAL)).thenReturn(null); assertNull(filter.retrieveProfile(session)); }
@SuppressWarnings("rawtypes") protected User retrieveProfile(Session session) { Object profile = session.getAttribute(PRINCIPAL); if (profile == null) { return null; } Client client = getClient(session); Class<UserProfile> type = Generics.getTypeParameter(client.getClass(), UserProfile.class); if (type.isAssignableFrom...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { @SuppressWarnings("rawtypes") protected User retrieveProfile(Session session) { Object profile = session.getAttribute(PRINCIPAL); if (profile == null) { return null; } Client client = getClient(session); Cla...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { @SuppressWarnings("rawtypes") protected User retrieveProfile(Session session) { Object profile = session.getAttribute(PRINCIPAL); if (profile == null) { return null; } Client client = getClient(session); Cla...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { @SuppressWarnings("rawtypes") protected User retrieveProfile(Session session) { Object profile = session.getAttribute(PRINCIPAL); if (profile == null) { return null; } Client client = getClient(session); Cla...
AuthenticationFilter extends AbstractSecurityFilter implements ContainerRequestFilter, ContainerResponseFilter { @SuppressWarnings("rawtypes") protected User retrieveProfile(Session session) { Object profile = session.getAttribute(PRINCIPAL); if (profile == null) { return null; } Client client = getClient(session); Cla...
@Test public void shouldHandlePUTAnnotation() throws Exception { PUTAnnotationHandler handler = new PUTAnnotationHandler(); handler.handle(metaData, mock(PUT.class), DummyResource.class.getMethod("put")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethods().iterator().next()...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandlePUTAnnotationWithPath() throws Exception { PUTAnnotationHandler handler = new PUTAnnotationHandler(); handler.handle(metaData, mock(PUT.class), DummyResource.class.getMethod("putWithPath")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethods().i...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandleDELETEAnnotation() throws Exception { DELETEAnnotationHandler handler = new DELETEAnnotationHandler(); handler.handle(metaData, mock(DELETE.class), DummyResource.class.getMethod("delete")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethods().it...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandleDELETEAnnotationWithPath() throws Exception { DELETEAnnotationHandler handler = new DELETEAnnotationHandler(); handler.handle(metaData, mock(DELETE.class), DummyResource.class.getMethod("deleteWithPath")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getReso...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandleHEADAnnotation() throws Exception { HEADAnnotationHandler handler = new HEADAnnotationHandler(); handler.handle(metaData, mock(HEAD.class), DummyResource.class.getMethod("head")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethods().iterator().n...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandleHEADAnnotationWithPath() throws Exception { HEADAnnotationHandler handler = new HEADAnnotationHandler(); handler.handle(metaData, mock(HEAD.class), DummyResource.class.getMethod("headWithPath")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethod...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandleOPTIONSAnnotation() throws Exception { OPTIONSAnnotationHandler handler = new OPTIONSAnnotationHandler(); handler.handle(metaData, mock(OPTIONS.class), DummyResource.class.getMethod("options")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.getResourceMethods...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldHandleOPTIONSAnnotationWithPath() throws Exception { OPTIONSAnnotationHandler handler = new OPTIONSAnnotationHandler(); handler.handle(metaData, mock(OPTIONS.class), DummyResource.class.getMethod("optionsWithPath")); assertTrue(! metaData.getResourceMethods().isEmpty()); assertEquals(metaData.ge...
@Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : null); ResourceMethodMetaData resourceMethod = new ResourceMethodMetaData(m...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
HttpMethodAnnotationHandler extends AbstractResourceAnnotationHandler { @Override public void handle(ResourceMetaData metaData, Annotation annotation, Method method) { Path path = ClassUtils.getAnnotation(method, Path.class); String methodPath = HttpUtil.concatPaths(metaData.getPath(), path != null ? path.value() : nul...
@Test public void shouldBuildResourceMetaData() throws Exception { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(DummyResource.class); ResourceMetaData metaData = builder.build(); assertEquals(metaData.getResourceMethods().size(), 1); assertEquals(metaData.getResourceMethods().iterator().next(), new Res...
@Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(subResource); builder.build(); } return metaData; }
ResourceMetaDataBuilder extends MetaDataBuilder<ResourceMetaData, AbstractResourceAnnotationHandler> { @Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(su...
ResourceMetaDataBuilder extends MetaDataBuilder<ResourceMetaData, AbstractResourceAnnotationHandler> { @Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(su...
ResourceMetaDataBuilder extends MetaDataBuilder<ResourceMetaData, AbstractResourceAnnotationHandler> { @Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(su...
ResourceMetaDataBuilder extends MetaDataBuilder<ResourceMetaData, AbstractResourceAnnotationHandler> { @Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(su...
@Test public void shouldBuildSubResourceMetaData() throws Exception { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(DummyResource.class); ResourceMetaData metaData = builder.build(); assertEquals(metaData.getSubResources().size(), 1); ResourceMetaData subResource = metaData.getSubResources().iterator()....
@Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(subResource); builder.build(); } return metaData; }
ResourceMetaDataBuilder extends MetaDataBuilder<ResourceMetaData, AbstractResourceAnnotationHandler> { @Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(su...
ResourceMetaDataBuilder extends MetaDataBuilder<ResourceMetaData, AbstractResourceAnnotationHandler> { @Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(su...
ResourceMetaDataBuilder extends MetaDataBuilder<ResourceMetaData, AbstractResourceAnnotationHandler> { @Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(su...
ResourceMetaDataBuilder extends MetaDataBuilder<ResourceMetaData, AbstractResourceAnnotationHandler> { @Override public ResourceMetaData build() { ResourceMetaData metaData = super.build(); for (ResourceMetaData subResource : metaData.getSubResources()) { ResourceMetaDataBuilder builder = new ResourceMetaDataBuilder(su...
@Test public void shouldNotFilterIfRequestIsNotACallback() { when(uriInfo.getPath()).thenReturn("/dummy"); filter.filter(context); verify(filter, never()).getSession(context, true); }
@Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skipping", request.getUriInfo().getPath()); return...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
@Test public void shouldCreateFilter() { MultivaluedMap<String, String> map = mock(MultivaluedMap.class); when(map.getFirst(ResourceUtil.PAGE_NO)).thenReturn("1"); when(map.getFirst(ResourceUtil.PER_PAGE)).thenReturn("10"); assertEquals(ResourceUtil.getFilter(map), new Filter(10, 1)); }
public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); }
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
@Test public void shouldCreateFilterWithSearchParams() { MultivaluedMap<String, String> map = mock(MultivaluedMap.class); when(map.getFirst(ResourceUtil.PAGE_NO)).thenReturn("1"); when(map.getFirst(ResourceUtil.PER_PAGE)).thenReturn("10"); when(map.getFirst("param1")).thenReturn("value1"); when(map.getFirst("param2"))....
public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); }
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
@Test public void shouldCreateFilterWithUnderscoreSeparatedSearchParams() { MultivaluedMap<String, String> map = mock(MultivaluedMap.class); when(map.getFirst(ResourceUtil.PAGE_NO)).thenReturn("1"); when(map.getFirst(ResourceUtil.PER_PAGE)).thenReturn("10"); when(map.getFirst("param_name1")).thenReturn("value1"); when(...
public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); }
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
ResourceUtil { public static Filter getFilter(MultivaluedMap<String, String> queryParams) { Integer perPage = (Integer) ConvertUtils.convert(queryParams.getFirst(PER_PAGE), Integer.class); Integer pageNo = (Integer) ConvertUtils.convert(queryParams.getFirst(PAGE_NO), Integer.class); return new Filter(perPage, pageNo); ...
@Test public void shouldGetContentAsMap() throws Exception { Map<String, Object> map = new HashMap<String, Object>(); map.put("key1", "value1"); byte[] bytes = new byte[10]; MediaType mediaType = mock(MediaType.class); HttpHeaders httpHeaders = mock(HttpHeaders.class); when(httpHeaders.getMediaType()).thenReturn(mediaT...
public static <T> T getContent(InputStream inputStream, Providers providers, HttpHeaders httpHeaders, Class<T> type, Type genericType, Annotation[] annotations) { MessageBodyReader<T> reader = providers.getMessageBodyReader(type, genericType, annotations, httpHeaders.getMediaType()); try { return reader.readFrom(type, ...
ResourceUtil { public static <T> T getContent(InputStream inputStream, Providers providers, HttpHeaders httpHeaders, Class<T> type, Type genericType, Annotation[] annotations) { MessageBodyReader<T> reader = providers.getMessageBodyReader(type, genericType, annotations, httpHeaders.getMediaType()); try { return reader....
ResourceUtil { public static <T> T getContent(InputStream inputStream, Providers providers, HttpHeaders httpHeaders, Class<T> type, Type genericType, Annotation[] annotations) { MessageBodyReader<T> reader = providers.getMessageBodyReader(type, genericType, annotations, httpHeaders.getMediaType()); try { return reader....
ResourceUtil { public static <T> T getContent(InputStream inputStream, Providers providers, HttpHeaders httpHeaders, Class<T> type, Type genericType, Annotation[] annotations) { MessageBodyReader<T> reader = providers.getMessageBodyReader(type, genericType, annotations, httpHeaders.getMediaType()); try { return reader....
ResourceUtil { public static <T> T getContent(InputStream inputStream, Providers providers, HttpHeaders httpHeaders, Class<T> type, Type genericType, Annotation[] annotations) { MessageBodyReader<T> reader = providers.getMessageBodyReader(type, genericType, annotations, httpHeaders.getMediaType()); try { return reader....
@Test public void shouldCheckIfStringIsCommaSeparated() { assertTrue(ResourceUtil.isCommaSeparated("test,test1")); assertFalse(ResourceUtil.isCommaSeparated("testtest1")); }
public static boolean isCommaSeparated(String value) { return value.contains(","); }
ResourceUtil { public static boolean isCommaSeparated(String value) { return value.contains(","); } }
ResourceUtil { public static boolean isCommaSeparated(String value) { return value.contains(","); } }
ResourceUtil { public static boolean isCommaSeparated(String value) { return value.contains(","); } static Filter getFilter(MultivaluedMap<String, String> queryParams); static Filter getFilter(MultivaluedMap<String, String> queryParams, final List<String> paramNames); static boolean isCommaSeparated(String value); sta...
ResourceUtil { public static boolean isCommaSeparated(String value) { return value.contains(","); } static Filter getFilter(MultivaluedMap<String, String> queryParams); static Filter getFilter(MultivaluedMap<String, String> queryParams, final List<String> paramNames); static boolean isCommaSeparated(String value); sta...
@Test public void shouldGetCommaSeparatedValues() { assertEquals(ResourceUtil.getCommaSeparatedValues("test,test1"), new String[]{"test", "test1"}); assertEquals(ResourceUtil.getCommaSeparatedValues("testtest1"), new String[]{"testtest1"}); }
public static String[] getCommaSeparatedValues(String value) { return value.split(","); }
ResourceUtil { public static String[] getCommaSeparatedValues(String value) { return value.split(","); } }
ResourceUtil { public static String[] getCommaSeparatedValues(String value) { return value.split(","); } }
ResourceUtil { public static String[] getCommaSeparatedValues(String value) { return value.split(","); } static Filter getFilter(MultivaluedMap<String, String> queryParams); static Filter getFilter(MultivaluedMap<String, String> queryParams, final List<String> paramNames); static boolean isCommaSeparated(String value)...
ResourceUtil { public static String[] getCommaSeparatedValues(String value) { return value.split(","); } static Filter getFilter(MultivaluedMap<String, String> queryParams); static Filter getFilter(MultivaluedMap<String, String> queryParams, final List<String> paramNames); static boolean isCommaSeparated(String value)...
@Test public void shouldInvokeMethodWithNoArguments() throws Throwable { Map<String, Object> values = new HashMap<String, Object>(); DummyModel model = new DummyModel(); byte[] bytes = new byte[10]; MediaType mediaType = mock(MediaType.class); HttpHeaders httpHeaders = mock(HttpHeaders.class); when(httpHeaders.getMedia...
public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?>>() { @Overrid...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
@Test public void shouldInvokeMethodWithArguments() throws Throwable { Map<String, Object> content = new HashMap<String, Object>(); content.put("value", "test123"); content.put("someNumber", 1L); Map<String, Object> values = new HashMap<String, Object>(); DummyModel model = new DummyModel(); byte[] bytes = new byte[10]...
public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?>>() { @Overrid...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
@Test public void shouldInvokeMethodWithArgumentsAndModel() throws Throwable { Map<String, Object> content = new HashMap<String, Object>(); content.put("value", "test123"); content.put("someNumber", 1L); Map<String, Object> values = new HashMap<String, Object>(); values.put("anotherModel", new DummyModel()); DummyModel...
public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?>>() { @Overrid...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
@Test(expectedExceptions=MinnalInstrumentationException.class) public void shouldThrowExceptionIfMethodNotFound() throws Throwable { Map<String, Object> values = new HashMap<String, Object>(); DummyModel model = new DummyModel(); byte[] bytes = new byte[10]; MediaType mediaType = mock(MediaType.class); HttpHeaders http...
public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?>>() { @Overrid...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
@Test public void shouldReturnUnAcceptableIfClientNameNotSet() { Session session = mock(Session.class); Response response = mock(Response.class); JaxrsWebContext webContext = mock(JaxrsWebContext.class); when(webContext.getResponse()).thenReturn(response); doReturn(session).when(filter).getSession(context, true); doRet...
@Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skipping", request.getUriInfo().getPath()); return...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
@Test(expectedExceptions=IllegalStateException.class) public void shouldThrowExceptionIfMethodThrowsAnyException() throws Throwable { Map<String, Object> values = new HashMap<String, Object>(); DummyModel model = new DummyModel(); byte[] bytes = new byte[10]; MediaType mediaType = mock(MediaType.class); HttpHeaders htt...
public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?>>() { @Overrid...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
ResourceUtil { public static Object invokeAction(Object model, String actionName, List<ParameterMetaData> parameters, byte[] rawContent, Providers providers, HttpHeaders httpHeaders, Map<String, Object> values) throws Throwable { List<Class<?>> types = Lists.transform(parameters, new Function<ParameterMetaData, Class<?...
@Test public void shouldScanClasses() { Scanner<Class<?>> scanner = mock(Scanner.class); enhancer.scanClasses(scanner); verify(scanner).scan(any(Listener.class)); }
protected List<Class<?>> scanClasses(Scanner<Class<?>> scanner) { final List<Class<?>> classes = new ArrayList<Class<?>>(); scanner.scan(new Listener<Class<?>>() { public void handle(Class<?> t) { classes.add(t); } }); return classes; }
ApplicationEnhancer { protected List<Class<?>> scanClasses(Scanner<Class<?>> scanner) { final List<Class<?>> classes = new ArrayList<Class<?>>(); scanner.scan(new Listener<Class<?>>() { public void handle(Class<?> t) { classes.add(t); } }); return classes; } }
ApplicationEnhancer { protected List<Class<?>> scanClasses(Scanner<Class<?>> scanner) { final List<Class<?>> classes = new ArrayList<Class<?>>(); scanner.scan(new Listener<Class<?>>() { public void handle(Class<?> t) { classes.add(t); } }); return classes; } ApplicationEnhancer(Application application, NamingStrategy n...
ApplicationEnhancer { protected List<Class<?>> scanClasses(Scanner<Class<?>> scanner) { final List<Class<?>> classes = new ArrayList<Class<?>>(); scanner.scan(new Listener<Class<?>>() { public void handle(Class<?> t) { classes.add(t); } }); return classes; } ApplicationEnhancer(Application application, NamingStrategy n...
ApplicationEnhancer { protected List<Class<?>> scanClasses(Scanner<Class<?>> scanner) { final List<Class<?>> classes = new ArrayList<Class<?>>(); scanner.scan(new Listener<Class<?>>() { public void handle(Class<?> t) { classes.add(t); } }); return classes; } ApplicationEnhancer(Application application, NamingStrategy n...
@Test void shouldFormatMetricName(){ FullHttpResponse response = mock(FullHttpResponse.class); when(response.getStatus()).thenReturn(HttpResponseStatus.OK); when(context.getResponse()).thenReturn(response); when(context.getMatchedRoute()).thenReturn("/facilities/{id}/stations/{station_id}"); when(request.getMethod()).t...
protected String getMetricName(MessageContext context, String metricName) { String name = null; if (! Strings.isNullOrEmpty(context.getMatchedRoute())) { name = context.getMatchedRoute(); } else { name = context.getApplication().getConfiguration().getName(); } name = formatName(name); return MetricRegistry.name(name, c...
ResponseMetricCollector extends MessageListenerAdapter { protected String getMetricName(MessageContext context, String metricName) { String name = null; if (! Strings.isNullOrEmpty(context.getMatchedRoute())) { name = context.getMatchedRoute(); } else { name = context.getApplication().getConfiguration().getName(); } na...
ResponseMetricCollector extends MessageListenerAdapter { protected String getMetricName(MessageContext context, String metricName) { String name = null; if (! Strings.isNullOrEmpty(context.getMatchedRoute())) { name = context.getMatchedRoute(); } else { name = context.getApplication().getConfiguration().getName(); } na...
ResponseMetricCollector extends MessageListenerAdapter { protected String getMetricName(MessageContext context, String metricName) { String name = null; if (! Strings.isNullOrEmpty(context.getMatchedRoute())) { name = context.getMatchedRoute(); } else { name = context.getApplication().getConfiguration().getName(); } na...
ResponseMetricCollector extends MessageListenerAdapter { protected String getMetricName(MessageContext context, String metricName) { String name = null; if (! Strings.isNullOrEmpty(context.getMatchedRoute())) { name = context.getMatchedRoute(); } else { name = context.getApplication().getConfiguration().getName(); } na...
@Test public void shouldSetStartTimeOnMessageReceive() { collector.onReceived(context); verify(context).addAttribute(eq(ResponseMetricCollector.START_TIME), any(Long.class)); }
@Override public void onReceived(MessageContext context) { context.addAttribute(START_TIME, clock.getTick()); }
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onReceived(MessageContext context) { context.addAttribute(START_TIME, clock.getTick()); } }
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onReceived(MessageContext context) { context.addAttribute(START_TIME, clock.getTick()); } }
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onReceived(MessageContext context) { context.addAttribute(START_TIME, clock.getTick()); } @Override void onReceived(MessageContext context); @Override void onSuccess(MessageContext context); @Override void onComplete(MessageContext context)...
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onReceived(MessageContext context) { context.addAttribute(START_TIME, clock.getTick()); } @Override void onReceived(MessageContext context); @Override void onSuccess(MessageContext context); @Override void onComplete(MessageContext context)...
@Test public void shouldSetSuccessfulOnSuccess() { FullHttpResponse response = mock(FullHttpResponse.class); when(response.getStatus()).thenReturn(HttpResponseStatus.OK); when(context.getResponse()).thenReturn(response); collector.onSuccess(context); verify(context).addAttribute(eq(ResponseMetricCollector.SUCCESSFUL), ...
@Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); }
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); } }
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); } }
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); } @Override void onReceived(MessageContext context); @Override void onSuccess(MessageContext context); @Override void onCo...
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); } @Override void onReceived(MessageContext context); @Override void onSuccess(MessageContext context); @Override void onCo...
@Test public void shouldSetNotSuccessfulOn4xx() { FullHttpResponse response = mock(FullHttpResponse.class); when(response.getStatus()).thenReturn(HttpResponseStatus.NOT_FOUND); when(context.getResponse()).thenReturn(response); collector.onSuccess(context); verify(context).addAttribute(eq(ResponseMetricCollector.SUCCESS...
@Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); }
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); } }
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); } }
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); } @Override void onReceived(MessageContext context); @Override void onSuccess(MessageContext context); @Override void onCo...
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onSuccess(MessageContext context) { context.addAttribute(SUCCESSFUL, context.getResponse().getStatus().code() < 400); } @Override void onReceived(MessageContext context); @Override void onSuccess(MessageContext context); @Override void onCo...
@Test public void shouldLogExceptionOnCompletion() { when(context.getAttribute(ResponseMetricCollector.SUCCESSFUL)).thenReturn(null); when(context.getApplication()).thenReturn(application); Meter meter = mock(Meter.class); when(metricRegistry.meter("test." + ResponseMetricCollector.EXCEPTIONS)).thenReturn(meter); colle...
@Override public void onComplete(MessageContext context) { String name = null; Boolean successful = (Boolean) context.getAttribute(SUCCESSFUL); if (successful == null) { name = MetricRegistry.name(context.getApplication().getConfiguration().getName(), EXCEPTIONS); MetricRegistries.getRegistry(context.getApplication().g...
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onComplete(MessageContext context) { String name = null; Boolean successful = (Boolean) context.getAttribute(SUCCESSFUL); if (successful == null) { name = MetricRegistry.name(context.getApplication().getConfiguration().getName(), EXCEPTIONS)...
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onComplete(MessageContext context) { String name = null; Boolean successful = (Boolean) context.getAttribute(SUCCESSFUL); if (successful == null) { name = MetricRegistry.name(context.getApplication().getConfiguration().getName(), EXCEPTIONS)...
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onComplete(MessageContext context) { String name = null; Boolean successful = (Boolean) context.getAttribute(SUCCESSFUL); if (successful == null) { name = MetricRegistry.name(context.getApplication().getConfiguration().getName(), EXCEPTIONS)...
ResponseMetricCollector extends MessageListenerAdapter { @Override public void onComplete(MessageContext context) { String name = null; Boolean successful = (Boolean) context.getAttribute(SUCCESSFUL); if (successful == null) { name = MetricRegistry.name(context.getApplication().getConfiguration().getName(), EXCEPTIONS)...
@Test public void shouldInitializeMetrics() { bundle.init(container, configuration); verify(container).registerListener(bundle); verify(container).registerListener(any(ResponseMetricCollector.class)); }
@Override public void init(Container container, MetricsBundleConfiguration configuration) { this.configuration = configuration; container.registerListener(this); container.registerListener(responseMetricCollector); }
MetricsBundle extends ContainerAdapter implements Bundle<MetricsBundleConfiguration> { @Override public void init(Container container, MetricsBundleConfiguration configuration) { this.configuration = configuration; container.registerListener(this); container.registerListener(responseMetricCollector); } }
MetricsBundle extends ContainerAdapter implements Bundle<MetricsBundleConfiguration> { @Override public void init(Container container, MetricsBundleConfiguration configuration) { this.configuration = configuration; container.registerListener(this); container.registerListener(responseMetricCollector); } }
MetricsBundle extends ContainerAdapter implements Bundle<MetricsBundleConfiguration> { @Override public void init(Container container, MetricsBundleConfiguration configuration) { this.configuration = configuration; container.registerListener(this); container.registerListener(responseMetricCollector); } @Override void ...
MetricsBundle extends ContainerAdapter implements Bundle<MetricsBundleConfiguration> { @Override public void init(Container container, MetricsBundleConfiguration configuration) { this.configuration = configuration; container.registerListener(this); container.registerListener(responseMetricCollector); } @Override void ...
@Test public void shouldStructureUrlIfEmptyOrNull() { assertEquals(HttpUtil.structureUrl(null), HttpUtil.SEPARATOR); assertEquals(HttpUtil.structureUrl(""), HttpUtil.SEPARATOR); }
public static String structureUrl(String url) { if (url == null || url.equals("")) { return SEPARATOR; } if (! url.startsWith(SEPARATOR)) { url = SEPARATOR + url; } if (url.endsWith(SEPARATOR)) { url = url.substring(0, url.length() - 1); } return url; }
HttpUtil { public static String structureUrl(String url) { if (url == null || url.equals("")) { return SEPARATOR; } if (! url.startsWith(SEPARATOR)) { url = SEPARATOR + url; } if (url.endsWith(SEPARATOR)) { url = url.substring(0, url.length() - 1); } return url; } }
HttpUtil { public static String structureUrl(String url) { if (url == null || url.equals("")) { return SEPARATOR; } if (! url.startsWith(SEPARATOR)) { url = SEPARATOR + url; } if (url.endsWith(SEPARATOR)) { url = url.substring(0, url.length() - 1); } return url; } }
HttpUtil { public static String structureUrl(String url) { if (url == null || url.equals("")) { return SEPARATOR; } if (! url.startsWith(SEPARATOR)) { url = SEPARATOR + url; } if (url.endsWith(SEPARATOR)) { url = url.substring(0, url.length() - 1); } return url; } static Map<String, String> getQueryParameters(URI uri)...
HttpUtil { public static String structureUrl(String url) { if (url == null || url.equals("")) { return SEPARATOR; } if (! url.startsWith(SEPARATOR)) { url = SEPARATOR + url; } if (url.endsWith(SEPARATOR)) { url = url.substring(0, url.length() - 1); } return url; } static Map<String, String> getQueryParameters(URI uri)...
@Test public void shouldGetRouteElements() { RoutePattern pattern = new RoutePattern("/orders/{order_id}/order_items"); assertEquals(pattern.getElements().size(), 3); assertEquals(pattern.getElements().get(0).getName(), "orders"); assertFalse(pattern.getElements().get(0).isParameter()); assertTrue(pattern.getElements()...
public List<RouteElement> getElements() { List<RouteElement> elements = new ArrayList<RoutePattern.RouteElement>(); for (String element : Splitter.on("/").split(pathPattern)) { elements.add(new RouteElement(element, PLACEHOLDER_PATTERN.matcher(element).matches())); } if (elements.isEmpty()) { System.out.println(""); } ...
RoutePattern { public List<RouteElement> getElements() { List<RouteElement> elements = new ArrayList<RoutePattern.RouteElement>(); for (String element : Splitter.on("/").split(pathPattern)) { elements.add(new RouteElement(element, PLACEHOLDER_PATTERN.matcher(element).matches())); } if (elements.isEmpty()) { System.out....
RoutePattern { public List<RouteElement> getElements() { List<RouteElement> elements = new ArrayList<RoutePattern.RouteElement>(); for (String element : Splitter.on("/").split(pathPattern)) { elements.add(new RouteElement(element, PLACEHOLDER_PATTERN.matcher(element).matches())); } if (elements.isEmpty()) { System.out....
RoutePattern { public List<RouteElement> getElements() { List<RouteElement> elements = new ArrayList<RoutePattern.RouteElement>(); for (String element : Splitter.on("/").split(pathPattern)) { elements.add(new RouteElement(element, PLACEHOLDER_PATTERN.matcher(element).matches())); } if (elements.isEmpty()) { System.out....
RoutePattern { public List<RouteElement> getElements() { List<RouteElement> elements = new ArrayList<RoutePattern.RouteElement>(); for (String element : Splitter.on("/").split(pathPattern)) { elements.add(new RouteElement(element, PLACEHOLDER_PATTERN.matcher(element).matches())); } if (elements.isEmpty()) { System.out....
@Test public void shouldReturnOkIfClientNameIsSet() throws RequiresHttpAction { Session session = mock(Session.class); Response response = mock(Response.class); JaxrsWebContext webContext = mock(JaxrsWebContext.class); when(webContext.getResponse()).thenReturn(response); doReturn(session).when(filter).getSession(contex...
@Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skipping", request.getUriInfo().getPath()); return...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
CallbackFilter extends AuthenticationFilter { @Override public void filter(ContainerRequestContext request) { URI uri = URI.create(getClients().getCallbackUrl()); if (! HttpUtil.structureUrl(request.getUriInfo().getPath()).equalsIgnoreCase(uri.getPath())) { logger.debug("Request path {} doesn't match callback url. Skip...
@Test public void shouldFetchParameterNames() { RoutePattern pattern = new RoutePattern("/orders/{order_id}/order_items/{id}"); assertNotNull(pattern.getParameterNames()); assertEquals(pattern.getParameterNames(), Arrays.asList("order_id", "id")); }
public List<String> getParameterNames() { return parameterNames; }
RoutePattern { public List<String> getParameterNames() { return parameterNames; } }
RoutePattern { public List<String> getParameterNames() { return parameterNames; } RoutePattern(String pathPattern); }
RoutePattern { public List<String> getParameterNames() { return parameterNames; } RoutePattern(String pathPattern); Map<String, String> match(String path); boolean matches(String path); List<String> getParameterNames(); String getPathPattern(); boolean isExactMatch(); List<RouteElement> getElements(); @Override int has...
RoutePattern { public List<String> getParameterNames() { return parameterNames; } RoutePattern(String pathPattern); Map<String, String> match(String path); boolean matches(String path); List<String> getParameterNames(); String getPathPattern(); boolean isExactMatch(); List<RouteElement> getElements(); @Override int has...
@Test public void shouldMatchAPathWithAlphaNumericParamsToPattern() { RoutePattern pattern = new RoutePattern("/orders/{order_id}/order_items/{id}"); assertTrue(pattern.matches("/orders/code1/order_items/1code")); }
public boolean matches(String path) { return regex.matcher(path).matches(); }
RoutePattern { public boolean matches(String path) { return regex.matcher(path).matches(); } }
RoutePattern { public boolean matches(String path) { return regex.matcher(path).matches(); } RoutePattern(String pathPattern); }
RoutePattern { public boolean matches(String path) { return regex.matcher(path).matches(); } RoutePattern(String pathPattern); Map<String, String> match(String path); boolean matches(String path); List<String> getParameterNames(); String getPathPattern(); boolean isExactMatch(); List<RouteElement> getElements(); @Overr...
RoutePattern { public boolean matches(String path) { return regex.matcher(path).matches(); } RoutePattern(String pathPattern); Map<String, String> match(String path); boolean matches(String path); List<String> getParameterNames(); String getPathPattern(); boolean isExactMatch(); List<RouteElement> getElements(); @Overr...
@Test public void shouldMatchAPathWithSpecialCharacterParamsToPattern() { RoutePattern pattern = new RoutePattern("/orders/{order_id}/order_items/{id}"); assertTrue(pattern.matches("/orders/order_1/order_items/order-item-1")); }
public boolean matches(String path) { return regex.matcher(path).matches(); }
RoutePattern { public boolean matches(String path) { return regex.matcher(path).matches(); } }
RoutePattern { public boolean matches(String path) { return regex.matcher(path).matches(); } RoutePattern(String pathPattern); }
RoutePattern { public boolean matches(String path) { return regex.matcher(path).matches(); } RoutePattern(String pathPattern); Map<String, String> match(String path); boolean matches(String path); List<String> getParameterNames(); String getPathPattern(); boolean isExactMatch(); List<RouteElement> getElements(); @Overr...
RoutePattern { public boolean matches(String path) { return regex.matcher(path).matches(); } RoutePattern(String pathPattern); Map<String, String> match(String path); boolean matches(String path); List<String> getParameterNames(); String getPathPattern(); boolean isExactMatch(); List<RouteElement> getElements(); @Overr...
@Test public void shouldGetParameterMapForAValidPath() { RoutePattern pattern = new RoutePattern("/orders/{order_id}/order_items/{id}"); Map<String, String> params = pattern.match("/orders/1/order_items/124"); assertNotNull(params); assertEquals(params.get("order_id"), "1"); assertEquals(params.get("id"), "124"); }
public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } return params; }
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
@Test public void shouldNotGetParameterMapForAnInvalidPath() { RoutePattern pattern = new RoutePattern("/orders/{order_id}/order_items/{id}"); Map<String, String> params = pattern.match("/orders/order_items/124"); assertNull(params); }
public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } return params; }
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
@Test public void shouldGetEmptyParameterMapForAPathWithoutParameters() { RoutePattern pattern = new RoutePattern("/orders/1/order_items/124"); Map<String, String> params = pattern.match("/orders/1/order_items/124"); assertNotNull(params); assertTrue(params.isEmpty()); }
public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } return params; }
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
@Test public void shouldMatchUrlEncodedString() { RoutePattern pattern = new RoutePattern("/orders/{order_id}"); Map<String, String> params = pattern.match("/orders/1234%2F1"); assertEquals(params.get("order_id"), "1234/1"); }
public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } return params; }
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
RoutePattern { public Map<String, String> match(String path) { Map<String, String> params = new HashMap<String, String>(); Matcher matcher = regex.matcher(path); if (!matcher.matches()) { return null; } for (int i = 1; i <= matcher.groupCount(); i++) { params.put(parameterNames.get(i-1), decode(matcher.group(i))); } re...
@Test public void shouldReturnOpenSessionInViewFilterOnRequestEvent() { DatabaseConfiguration configuration = mock(DatabaseConfiguration.class); JerseyApplicationEventListener listener = new JerseyApplicationEventListener(configuration); RequestEvent requestEvent = mock(RequestEvent.class); RequestEventListener eventLi...
@Override public RequestEventListener onRequest(RequestEvent requestEvent) { return new OpenSessionInViewFilter(configuration); }
JerseyApplicationEventListener implements ApplicationEventListener { @Override public RequestEventListener onRequest(RequestEvent requestEvent) { return new OpenSessionInViewFilter(configuration); } }
JerseyApplicationEventListener implements ApplicationEventListener { @Override public RequestEventListener onRequest(RequestEvent requestEvent) { return new OpenSessionInViewFilter(configuration); } JerseyApplicationEventListener(DatabaseConfiguration configuration); }
JerseyApplicationEventListener implements ApplicationEventListener { @Override public RequestEventListener onRequest(RequestEvent requestEvent) { return new OpenSessionInViewFilter(configuration); } JerseyApplicationEventListener(DatabaseConfiguration configuration); @Override void onEvent(ApplicationEvent event); @Ove...
JerseyApplicationEventListener implements ApplicationEventListener { @Override public RequestEventListener onRequest(RequestEvent requestEvent) { return new OpenSessionInViewFilter(configuration); } JerseyApplicationEventListener(DatabaseConfiguration configuration); @Override void onEvent(ApplicationEvent event); @Ove...
@Test public void shouldInitializeEntityManagerWhenRequestReceived() throws IOException { filter.requestReceived(request); verify(context).getEntityManager(); }
protected void requestReceived(ContainerRequest request) { JPAContext context = getContext(); context.getEntityManager(); contextCreated.set(true); }
OpenSessionInViewFilter implements RequestEventListener { protected void requestReceived(ContainerRequest request) { JPAContext context = getContext(); context.getEntityManager(); contextCreated.set(true); } }
OpenSessionInViewFilter implements RequestEventListener { protected void requestReceived(ContainerRequest request) { JPAContext context = getContext(); context.getEntityManager(); contextCreated.set(true); } OpenSessionInViewFilter(DatabaseConfiguration configuration); }
OpenSessionInViewFilter implements RequestEventListener { protected void requestReceived(ContainerRequest request) { JPAContext context = getContext(); context.getEntityManager(); contextCreated.set(true); } OpenSessionInViewFilter(DatabaseConfiguration configuration); @Override void onEvent(RequestEvent event); Databa...
OpenSessionInViewFilter implements RequestEventListener { protected void requestReceived(ContainerRequest request) { JPAContext context = getContext(); context.getEntityManager(); contextCreated.set(true); } OpenSessionInViewFilter(DatabaseConfiguration configuration); @Override void onEvent(RequestEvent event); Databa...
@Test public void shouldInitPlugin() { EntityManagerFactory factory = mock(EntityManagerFactory.class); when(provider.createContainerEntityManagerFactory(persistenceUnitInfo, null)).thenReturn(factory); plugin.init(application); assertEquals(JPA.instance.getDefaultConfig().getEntityManagerFactory(), factory); }
public void init(Application<? extends ApplicationConfiguration> application) { List<PersistenceProvider> providers = getProviders(); if (providers == null || providers.isEmpty()) { throw new MinnalException("No JPA persistence provider found"); } PersistenceProvider provider = providers.get(0); PersistenceUnitInfo inf...
JPAPlugin implements Plugin { public void init(Application<? extends ApplicationConfiguration> application) { List<PersistenceProvider> providers = getProviders(); if (providers == null || providers.isEmpty()) { throw new MinnalException("No JPA persistence provider found"); } PersistenceProvider provider = providers.g...
JPAPlugin implements Plugin { public void init(Application<? extends ApplicationConfiguration> application) { List<PersistenceProvider> providers = getProviders(); if (providers == null || providers.isEmpty()) { throw new MinnalException("No JPA persistence provider found"); } PersistenceProvider provider = providers.g...
JPAPlugin implements Plugin { public void init(Application<? extends ApplicationConfiguration> application) { List<PersistenceProvider> providers = getProviders(); if (providers == null || providers.isEmpty()) { throw new MinnalException("No JPA persistence provider found"); } PersistenceProvider provider = providers.g...
JPAPlugin implements Plugin { public void init(Application<? extends ApplicationConfiguration> application) { List<PersistenceProvider> providers = getProviders(); if (providers == null || providers.isEmpty()) { throw new MinnalException("No JPA persistence provider found"); } PersistenceProvider provider = providers.g...
@Test public void shouldCreateSession() { Session session = sessionStore.createSession("test123"); assertNotNull(session); assertEquals(JpaSession.one("id", "test123"), session); }
public Session createSession(String id) { JpaSession session = new JpaSession(id); session.persist(); return session; }
JpaSessionStore implements SessionStore { public Session createSession(String id) { JpaSession session = new JpaSession(id); session.persist(); return session; } }
JpaSessionStore implements SessionStore { public Session createSession(String id) { JpaSession session = new JpaSession(id); session.persist(); return session; } }
JpaSessionStore implements SessionStore { public Session createSession(String id) { JpaSession session = new JpaSession(id); session.persist(); return session; } Session createSession(String id); JpaSession getSession(String id); void deleteSession(String id); void save(Session session); JpaSession findSessionBy(Strin...
JpaSessionStore implements SessionStore { public Session createSession(String id) { JpaSession session = new JpaSession(id); session.persist(); return session; } Session createSession(String id); JpaSession getSession(String id); void deleteSession(String id); void save(Session session); JpaSession findSessionBy(Strin...
@Test public void shouldHandleException() { ConstraintViolation<?> violation = mock(ConstraintViolation.class); Path path = mock(Path.class); when(path.toString()).thenReturn("dummyField"); when(violation.getPropertyPath()).thenReturn(path); when(violation.getMessage()).thenReturn("dummy message"); when(violation.getIn...
@Override public Response toResponse(ConstraintViolationException exception) { ConstraintViolationException ex = (ConstraintViolationException) exception; List<FieldError> errors = new ArrayList<FieldError>(); for (ConstraintViolation<?> violation : ex.getConstraintViolations()) { errors.add(new FieldError(Inflector.un...
ConstraintViolationExceptionHandler implements ExceptionMapper<ConstraintViolationException> { @Override public Response toResponse(ConstraintViolationException exception) { ConstraintViolationException ex = (ConstraintViolationException) exception; List<FieldError> errors = new ArrayList<FieldError>(); for (Constraint...
ConstraintViolationExceptionHandler implements ExceptionMapper<ConstraintViolationException> { @Override public Response toResponse(ConstraintViolationException exception) { ConstraintViolationException ex = (ConstraintViolationException) exception; List<FieldError> errors = new ArrayList<FieldError>(); for (Constraint...
ConstraintViolationExceptionHandler implements ExceptionMapper<ConstraintViolationException> { @Override public Response toResponse(ConstraintViolationException exception) { ConstraintViolationException ex = (ConstraintViolationException) exception; List<FieldError> errors = new ArrayList<FieldError>(); for (Constraint...
ConstraintViolationExceptionHandler implements ExceptionMapper<ConstraintViolationException> { @Override public Response toResponse(ConstraintViolationException exception) { ConstraintViolationException ex = (ConstraintViolationException) exception; List<FieldError> errors = new ArrayList<FieldError>(); for (Constraint...