Examples of UriParam


Examples of com.wesabe.api.accounts.params.UriParam

      this.weirdOne = new Account("Brian Has Insane Accounts", USD);
      weirdOne.setRelativeId(400);
     
      when(context.getAccountDAO().findVisibleAccounts(anyString())).thenReturn(new AccountList(checking, savings, weirdOne));
     
      this.accountUris = ImmutableSet.of(new UriParam("/accounts/2"), new UriParam("/accounts/400"));
    }
View Full Code Here

Examples of com.wesabe.api.accounts.params.UriParam

      this.savings = new Account("Savings", USD);
      savings.setRelativeId(1);
     
      when(context.getAccountDAO().findVisibleAccounts(anyString())).thenReturn(new AccountList(checking, savings));
     
      this.accountUris = ImmutableSet.of(new UriParam("/accounts/2"), new UriParam("/accounts/woof"), new UriParam("/accouFFFnts/2"));
    }
View Full Code Here

Examples of com.wesabe.api.accounts.params.UriParam

  public static class Parsing_A_Valid_URI {
    private UriParam param;
   
    @Before
    public void setup() throws Exception {
      this.param = new UriParam("/whee/1");
    }
View Full Code Here

Examples of com.wesabe.api.accounts.params.UriParam

  public static class Parsing_A_Invalid_URI {
   
    @Test
    public void itThrowsA400BadRequestWebApplicationException() throws Exception {
      try {
        new UriParam("/%dg");
        fail("should have thrown a WebApplicationException but didn't");
      } catch (WebApplicationException e) {
        assertEquals(400, e.getResponse().getStatus());
        assertEquals("Invalid parameter: /%dg (not a valid URI).", e.getResponse().getEntity());
      }
View Full Code Here

Examples of com.wesabe.api.accounts.params.UriParam

      this.representation = mock(XmlsonObject.class);
      when(context.getIntervalSummaryPresenter().present(Mockito.any(ImmutableMap.class), Mockito.any(Locale.class))).thenReturn(representation);
     
      this.uneditedOnly = new BooleanParam("false");
     
      this.accountUris = ImmutableSet.of(new UriParam("/accounts/1"));
     
      this.tagUris = ImmutableSet.of("/tags/food");
     
      this.merchantNames = ImmutableSet.of("Starbucks");
     
View Full Code Here

Examples of org.apache.camel.spi.UriParam

            List<VariableElement> fieldElements = ElementFilter.fieldsIn(classElement.getEnclosedElements());
            if (fieldElements.isEmpty()) {
                break;
            }
            for (VariableElement fieldElement : fieldElements) {
                UriParam param = fieldElement.getAnnotation(UriParam.class);
                String fieldName = fieldElement.getSimpleName().toString();
                if (param != null) {
                    String name = param.name();
                    if (isNullOrEmpty(name)) {
                        name = fieldName;
                    }
                    name = prefix + name;

                    String defaultValue = param.defaultValue();
                    String defaultValueNote = param.defaultValueNote();

                    // if the field type is a nested parameter then iterate through its fields
                    TypeMirror fieldType = fieldElement.asType();
                    String fieldTypeName = fieldType.toString();
                    TypeElement fieldTypeElement = findTypeElement(roundEnv, fieldTypeName);
View Full Code Here

Examples of org.apache.camel.spi.UriParam

            List<VariableElement> fieldElements = ElementFilter.fieldsIn(classElement.getEnclosedElements());
            if (fieldElements.isEmpty()) {
                break;
            }
            for (VariableElement fieldElement : fieldElements) {
                UriParam param = fieldElement.getAnnotation(UriParam.class);
                String fieldName = fieldElement.getSimpleName().toString();
                if (param != null) {
                    String name = param.name();
                    if (Strings.isNullOrEmpty(name)) {
                        name = fieldName;
                    }
                    name = prefix + name;
                    // if the field type is a nested parameter then iterate through its fields
View Full Code Here

Examples of org.apache.camel.spi.UriParam

            final SortedMap<String, ParameterConfiguration> parameterMap, Class<?> aClass,
            final String prefix) {
        ReflectionHelper.doWithFields(aClass, new ReflectionHelper.FieldCallback() {
            @Override
            public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
                UriParam uriParam = field.getAnnotation(UriParam.class);
                if (uriParam != null) {
                    String name = uriParam.name();
                    if (ObjectHelper.isEmpty(name)) {
                        name = field.getName();
                    }
                    String propertyName = prefix + name;
View Full Code Here

Examples of org.apache.camel.spi.UriParam

            List<VariableElement> fieldElements = ElementFilter.fieldsIn(classElement.getEnclosedElements());
            if (fieldElements.isEmpty()) {
                break;
            }
            for (VariableElement fieldElement : fieldElements) {
                UriParam param = fieldElement.getAnnotation(UriParam.class);
                String fieldName = fieldElement.getSimpleName().toString();
                if (param != null) {
                    String name = param.name();
                    if (Strings.isNullOrEmpty(name)) {
                        name = fieldName;
                    }
                    name = prefix + name;
                    // if the field type is a nested parameter then iterate through its fields
View Full Code Here

Examples of org.apache.camel.spi.UriParam

            final SortedMap<String, ParameterConfiguration> parameterMap, Class<?> aClass,
            final String prefix) {
        ReflectionHelper.doWithFields(aClass, new ReflectionHelper.FieldCallback() {
            @Override
            public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
                UriParam uriParam = field.getAnnotation(UriParam.class);
                if (uriParam != null) {
                    String name = uriParam.name();
                    if (ObjectHelper.isEmpty(name)) {
                        name = field.getName();
                    }
                    String propertyName = prefix + name;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.