@@ -0,0 +1,1242 @@
+package com.restify.http.client.interceptor.authentication;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertTrue;%0Aimport static org.mockito.Mockito.when;%0A%0Aimport java.net.URI;%0Aimport java.util.Optional;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0A%0Aimport com.restify.http.client.EndpointRequest;%0Aimport com.restify.http.client.Header;%0Aimport com.restify.http.client.authentication.Authentication;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class AuthenticationEndpoinRequestInterceptorTest %7B%0A%0A%09@Mock%0A%09private Authentication authenticationMock;%0A%0A%09@InjectMocks%0A%09private AuthenticationEndpoinRequestInterceptor interceptor;%0A%0A%09@Test%0A%09public void shouldCreateAuthorizationHeader() %7B%0A%09%09when(authenticationMock.content())%0A%09%09%09.thenReturn(%22abc:123%22);%0A%0A%09%09EndpointRequest endpointRequest = new EndpointRequest(URI.create(%22http://my.api.com%22), %22GET%22);%0A%0A%09%09interceptor.intercepts(endpointRequest);%0A%0A%09%09Optional%3CHeader%3E authorizationHeader = endpointRequest.headers().get(%22Authorization%22);%0A%0A%09%09assertTrue(authorizationHeader.isPresent());%0A%09%09assertEquals(%22abc:123%22, authorizationHeader.get().value());%0A%09%7D%0A%0A%7D%0A

Implementa teste de unidade para o interceptor de autorizacao