Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AF773200C4B for ; Mon, 20 Mar 2017 12:13:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AE179160B8F; Mon, 20 Mar 2017 11:13:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 04BFF160B76 for ; Mon, 20 Mar 2017 12:13:50 +0100 (CET) Received: (qmail 15957 invoked by uid 500); 20 Mar 2017 11:13:50 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 15948 invoked by uid 99); 20 Mar 2017 11:13:50 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Mar 2017 11:13:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1D039DFE5C; Mon, 20 Mar 2017 11:13:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-7264,CXF-7286] Adding missing test resources Date: Mon, 20 Mar 2017 11:13:50 +0000 (UTC) archived-at: Mon, 20 Mar 2017 11:13:51 -0000 Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 2458c5c8f -> c15592b4a [CXF-7264,CXF-7286] Adding missing test resources Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c15592b4 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c15592b4 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c15592b4 Branch: refs/heads/3.1.x-fixes Commit: c15592b4a48a14f29c899ac4590273606f7ba0e3 Parents: 2458c5c Author: Sergey Beryozkin Authored: Mon Mar 20 11:11:55 2017 +0000 Committer: Sergey Beryozkin Committed: Mon Mar 20 11:13:34 2017 +0000 ---------------------------------------------------------------------- .../security/oauth2/common/UserSubjectTest.java | 39 ++++++++++++++++++++ .../oauth2/provider/TestingUserSubject.java | 35 ++++++++++++++++++ 2 files changed, 74 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/c15592b4/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/common/UserSubjectTest.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/common/UserSubjectTest.java b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/common/UserSubjectTest.java new file mode 100644 index 0000000..52d77c0 --- /dev/null +++ b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/common/UserSubjectTest.java @@ -0,0 +1,39 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.rs.security.oauth2.common; + +import java.util.Collections; + +import org.junit.Assert; +import org.junit.Test; + +public class UserSubjectTest extends Assert { + + @Test + public void testId() { + UserSubject userSubject = new UserSubject(); + assertNotNull(userSubject.getId()); + userSubject = new UserSubject("someLogin"); + assertNotNull(userSubject.getId()); + userSubject = new UserSubject("someLogin", Collections.singletonList("somerole")); + assertNotNull(userSubject.getId()); + UserSubject newSubject = new UserSubject(userSubject); + assertEquals(userSubject.getId(), newSubject.getId()); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/cxf/blob/c15592b4/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/TestingUserSubject.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/TestingUserSubject.java b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/TestingUserSubject.java new file mode 100644 index 0000000..e762f3f --- /dev/null +++ b/rt/rs/security/oauth-parent/oauth2/src/test/java/org/apache/cxf/rs/security/oauth2/provider/TestingUserSubject.java @@ -0,0 +1,35 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.rs.security.oauth2.provider; + +import javax.persistence.Entity; + +import org.apache.cxf.rs.security.oauth2.common.UserSubject; + +@Entity +public class TestingUserSubject extends UserSubject { + + public TestingUserSubject() { + super(); + } + + public TestingUserSubject(String login) { + super(login); + } +} \ No newline at end of file