[java-idp-plugin-oidc-rp] branch main updated: Remove redundant test
Phil Smart
philip.smart at jisc.ac.uk
Tue Mar 14 14:45:39 UTC 2023
This is an automated email from the git hooks/post-receive script.
philsmart pushed a commit to branch main
in repository java-idp-plugin-oidc-rp.
View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-oidc-rp.git;a=commit;h=169e6f8eea46f185d3132da8c7b003e0c1f6b529
The following commit(s) were added to refs/heads/main by this push:
new 169e6f8 Remove redundant test
169e6f8 is described below
commit 169e6f8eea46f185d3132da8c7b003e0c1f6b529
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Mar 14 14:45:37 2023 +0000
Remove redundant test
---
.../DefaultAuthCodeTokenRequestEncoderTest.java | 73 ----------------------
1 file changed, 73 deletions(-)
diff --git a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/encoding/impl/DefaultAuthCodeTokenRequestEncoderTest.java b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/encoding/impl/DefaultAuthCodeTokenRequestEncoderTest.java
deleted file mode 100644
index d0cd2f5..0000000
--- a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/encoding/impl/DefaultAuthCodeTokenRequestEncoderTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the University Corporation for Advanced Internet Development,
- * Inc. (UCAID) under one or more contributor license agreements. See the
- * NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The UCAID 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 net.shibboleth.idp.plugin.authn.oidc.rp.encoding.impl;
-
-import static org.junit.Assert.assertTrue;
-import static org.testng.Assert.assertNotNull;
-
-import java.nio.charset.StandardCharsets;
-
-import org.apache.http.HttpEntityEnclosingRequest;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import com.nimbusds.oauth2.sdk.auth.ClientAuthentication;
-import com.nimbusds.oauth2.sdk.auth.ClientSecretBasic;
-import com.nimbusds.oauth2.sdk.auth.Secret;
-import com.nimbusds.oauth2.sdk.http.HTTPRequest;
-import com.nimbusds.oauth2.sdk.id.ClientID;
-
-import net.shibboleth.idp.plugin.authn.oidc.rp.context.OIDCPeerEntityContext;
-import net.shibboleth.idp.plugin.authn.oidc.rp.impl.AbstractOIDCTest;
-import net.shibboleth.oidc.authn.context.OAuth2ClientAuthenticationContext;
-
-/** Tests for the DefaultTokenRequestEncoder.*/
-public class DefaultAuthCodeTokenRequestEncoderTest extends AbstractOIDCTest {
-
- /** The encoder to test.*/
- private DefaultAuthCodeTokenRequestEncoder encoder;
-
- @Override
- @BeforeMethod
- public void setup() throws Exception {
- super.setup();
- encoder = new DefaultAuthCodeTokenRequestEncoder();
- final var authContext = prc.getOutboundMessageContext().getSubcontext(OIDCPeerEntityContext.class, true)
- .getSubcontext(OAuth2ClientAuthenticationContext.class, true);
- authContext.setClientAuthentication(new ClientSecretBasic(new ClientID("client_id"), new Secret("secret")));
- }
-
-
- @Test
- public void testEncoder_Success() throws Exception {
- encoder.initialize();
- final HttpUriRequest request = encoder.apply(prc);
- assertNotNull(request);
- assertTrue(request instanceof HttpEntityEnclosingRequest);
- assertNotNull(request.getFirstHeader("Authorization"));
- assertNotNull(((HttpEntityEnclosingRequest)request).getEntity().getContent());
- final String content = new String(
- ((HttpEntityEnclosingRequest)request).getEntity().getContent().readAllBytes(), StandardCharsets.UTF_8);
- assertTrue("grant_type expected in request", content.contains("grant_type"));
- assertTrue("authorization_code expected in request", content.contains("authorization_code"));
- assertTrue("code expected in request", content.contains("code"));
- assertTrue("redirect_uri expected in request", content.contains("redirect_uri"));
- }
-
-}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list