cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-7264,CXF-7286] Adding missing test resources
Date Mon, 20 Mar 2017 11:12:10 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 9d64bcedb -> 34cc20de2


[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/34cc20de
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/34cc20de
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/34cc20de

Branch: refs/heads/master
Commit: 34cc20de28889be945c25d22748441fe6f3d5c5d
Parents: 9d64bce
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Mon Mar 20 11:11:55 2017 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Mon Mar 20 11:11:55 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/34cc20de/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/34cc20de/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


Mime
View raw message