1 /*
2 * Copyright 2026 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.bremersee.spring.boot.autoconfigure.keycloak;
18
19 import static org.mockito.Mockito.doReturn;
20 import static org.mockito.Mockito.mock;
21 import static org.mockito.Mockito.verify;
22
23 import org.bremersee.keycloak.api.webflux.AdminApi;
24 import org.junit.jupiter.api.BeforeEach;
25 import org.junit.jupiter.api.Test;
26 import reactivefeign.ReactiveFeign.Builder;
27
28 /**
29 * Decode not found keycloak admin api customizer test.
30 *
31 * @author Christian Bremer
32 */
33 class DecodeNotFoundKeycloakAdminApiCustomizerTest {
34
35 private DecodeNotFoundKeycloakAdminApiCustomizer target;
36
37 /**
38 * Sets up.
39 */
40 @BeforeEach
41 void setUp() {
42 target = new DecodeNotFoundKeycloakAdminApiCustomizer();
43 }
44
45 /**
46 * Customize.
47 */
48 @Test
49 void customize() {
50 //noinspection unchecked
51 Builder<AdminApi> builder = mock(Builder.class);
52 doReturn(builder)
53 .when(builder)
54 .decode404();
55 target.customize(builder);
56 verify(builder).decode404();
57 }
58 }