From eafdf3bc35098821fbdbbd56d588fb2c7180d6a9 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 23 May 2025 06:46:19 +0100 Subject: [PATCH] Remove accidentally added test class --- .../oauth2authorizationserver/TempTests.java | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 security/security-oauth2-authorization-server/src/appTest/java/com/example/security/oauth2authorizationserver/TempTests.java diff --git a/security/security-oauth2-authorization-server/src/appTest/java/com/example/security/oauth2authorizationserver/TempTests.java b/security/security-oauth2-authorization-server/src/appTest/java/com/example/security/oauth2authorizationserver/TempTests.java deleted file mode 100644 index 4afcab9e..00000000 --- a/security/security-oauth2-authorization-server/src/appTest/java/com/example/security/oauth2authorizationserver/TempTests.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2025 the original author or authors. - * - * Licensed 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 - * - * https://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 com.example.security.oauth2authorizationserver; - -import java.util.function.Consumer; - -import org.junit.jupiter.api.Test; - -import org.springframework.http.HttpHeaders; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.reactive.function.BodyInserters; -import org.springframework.web.reactive.function.client.WebClient; - -/** - * @author pwebb - */ -public class TempTests { - - @Test - void performTokenRequestWhenInvalidClientCredentialsThenUnauthorized() { - WebClient client = WebClient.create("http://localhost:8080"); - // @formatter:off - MultiValueMap formData = new LinkedMultiValueMap<>(); - formData.add("grant_type", "client_credentials"); - formData.add("scope", "message:read"); - System.out.println( - client.post().uri("/oauth2/token").headers(badCredentials()) - .body(BodyInserters.fromFormData(formData)) - .exchange().block().statusCode()); - - -// .expectStatus().isUnauthorized() -// .expectBody().jsonPath("$.error").isEqualTo("invalid_client"); - // @formatter:on - } - - private static Consumer badCredentials() { - return (headers) -> headers.setBasicAuth("bad", "password"); - } - -}