Examples of User


Examples of org.springframework.data.repository.sample.User

   * @see DATACMNS-376
   */
  @Test
  public void returnsPersistentEntityForProxiedClass() {

    User user = mock(User.class);
    assertThat(repositories.getPersistentEntity(user.getClass()), is(notNullValue()));
  }
View Full Code Here

Examples of org.springframework.data.rest.webmvc.mongodb.User

    Address address = new Address();
    address.street = "Foo";
    address.zipCode = "Bar";

    this.user = new User();
    this.user.firstname = "Oliver";
    this.user.lastname = "Gierke";
    this.user.address = address;
  }
View Full Code Here

Examples of org.springframework.integration.samples.enricher.User

            = new ClassPathXmlApplicationContext("/META-INF/spring/integration/spring-integration-context.xml",
                                                  UserServiceTest.class);

        final UserService service = context.getBean(UserService.class);

        User user = new User("foo", null, null);
        final User fullUser = service.findUser(user);

        assertEquals("foo", fullUser.getUsername());
        assertEquals("foo@springintegration.org", fullUser.getEmail());
        assertEquals("secret", fullUser.getPassword());

    }
View Full Code Here

Examples of org.springframework.integration.samples.kafka.user.User

    Log logger = LogFactory.getLog(getClass());

    @Override
    public Message<?> transform(Message<?> message) {
        if(message.getPayload().getClass().isAssignableFrom(User.class)) {
            User user = (User) message.getPayload();
            user.setFirstName(user.getFirstName().toString()+user.getFirstName());
            logger.info("user confirmed " + user.getFirstName());
            return MessageBuilder.withPayload(user).copyHeaders(message.getHeaders()).build();
        }
        return message;
    }
View Full Code Here

Examples of org.springframework.issues.domain.User

    assertEquals(names.size(), 5);
  }

  @Test
  public void testAddUser() throws Exception {
    User user = new User();
    user.setId(100);
    user.setName("Neu");
    user.setCity("Zürich");
    userService.saveUser(user);
    List<String> names = userService.getNames();
    assertEquals(names.size(), 6);
    assertTrue(names.contains("Neu"));
  }
View Full Code Here

Examples of org.springframework.security.config.annotation.issue50.domain.User

            }
            public Authentication authenticate(Authentication authentication)
                    throws AuthenticationException {
                Object principal = authentication.getPrincipal();
                String username = String.valueOf(principal);
                User user = myUserRepository.findByUsername(username);
                if(user == null) {
                    throw new UsernameNotFoundException("No user for principal "+principal);
                }
                if(!authentication.getCredentials().equals(user.getPassword())) {
                    throw new BadCredentialsException("Invalid password");
                }
                return new TestingAuthenticationToken(principal, null, "ROLE_USER");
            }
        };
View Full Code Here

Examples of org.springframework.security.core.userdetails.User

        List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
        for (Entitlement entitlement : entitlementDAO.findAll()) {
            authorities.add(new SimpleGrantedAuthority(entitlement.getName()));
        }

        UserDetails userDetails = new User(adminUser, "FAKE_PASSWORD", true, true, true, true, authorities);
        Authentication authentication = new TestingAuthenticationToken(userDetails, "FAKE_PASSWORD", authorities);
        SecurityContextHolder.getContext().setAuthentication(authentication);
    }
View Full Code Here

Examples of org.springframework.security.userdetails.User

      String role = PentahoSystem
        .getSystemSetting( "anonymous-authentication/anonymous-role", "Anonymous" ); //$NON-NLS-1$//$NON-NLS-2$
      GrantedAuthority[] authorities = new GrantedAuthority[] { new GrantedAuthorityImpl( role ) };

      Authentication auth =
        new AnonymousAuthenticationToken( "anonymousUser", new User( user, "ignored", true, true, true, true,
          authorities ), authorities );

      SecurityContextHolder.getContext().setAuthentication( auth );
      return callable.call();
    } finally {
View Full Code Here

Examples of org.springframework.social.quickstart.user.User

   * Request-scoped data access object providing access to the current user's connections.
   */
  @Bean
  @Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
  public ConnectionRepository connectionRepository() {
      User user = SecurityContext.getCurrentUser();
      return usersConnectionRepository().createConnectionRepository(user.getId());
  }
View Full Code Here

Examples of org.springmodules.feedxt.domain.User

        user.register(username, password);
        this.userRepository.addUser(user);
    }
   
    public User getUserAccount(String username, String password) {
        User user = this.userRepository.getUserByUsername(username);
        if (user != null && user.matchPassword(password)) {
            return user;
        } else {
            return null;
        }
    }
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.