// Path: src/main/java/com/thoughtworks/go/strongauth/authentication/AuthenticationRequest.java
// @Value
// public class AuthenticationRequest {
//     private final String username;
//     private final String password;
// }


import com.google.common.base.Optional;
import com.thoughtworks.go.plugin.api.request.GoPluginApiRequest;
import com.thoughtworks.go.strongauth.authentication.AuthenticationRequest;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
package com.thoughtworks.go.strongauth.wire;



public class GoAuthenticationRequestDecoderTest {

    @Test
    public void testDecodeAuthenticationValidRequest() {
        GoPluginApiRequest request = mock(GoPluginApiRequest.class);
        when(request.requestBody()).thenReturn("{\"username\":\"uname\",\"password\":\"pword\"}");

        GoAuthenticationRequestDecoder decoder = new GoAuthenticationRequestDecoder();
// Path: src/main/java/com/thoughtworks/go/strongauth/authentication/AuthenticationRequest.java
// @Value
// public class AuthenticationRequest {
//     private final String username;
//     private final String password;
// }


// Path: src/test/java/com/thoughtworks/go/strongauth/wire/GoAuthenticationRequestDecoderTest.java
import com.google.common.base.Optional;
import com.thoughtworks.go.plugin.api.request.GoPluginApiRequest;
import com.thoughtworks.go.strongauth.authentication.AuthenticationRequest;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

package com.thoughtworks.go.strongauth.wire;



public class GoAuthenticationRequestDecoderTest {

    @Test
    public void testDecodeAuthenticationValidRequest() {
        GoPluginApiRequest request = mock(GoPluginApiRequest.class);
        when(request.requestBody()).thenReturn("{\"username\":\"uname\",\"password\":\"pword\"}");

        GoAuthenticationRequestDecoder decoder = new GoAuthenticationRequestDecoder();
        Optional<AuthenticationRequest> maybeRequest = decoder.decode(request);