// Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketRepository.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketRepository implements Serializable {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @JsonProperty("is_private")
//     private boolean _private;
// 
//     @JsonProperty("utc_created_on")
//     @JsonDeserialize(using = UTCDateDeserializer.class)
//     private Date createdAt;
// 
//     @JsonProperty
//     private String description;
// 
//     @JsonProperty("has_wiki")
//     private boolean hasWiki;
// 
//     @JsonProperty("utc_last_updated")
//     @JsonDeserialize(using = UTCDateDeserializer.class)
//     private Date lastUpdatedOn;
// 
//     @JsonProperty
//     private String name;
// 
//     @JsonProperty
//     private String owner;
// 
//     @JsonProperty("read_only")
//     private boolean readOnly;
// 
//     @JsonProperty
//     private BitBucketSCM scm;
// 
//     @JsonProperty
//     private long size;
// 
//     @JsonProperty
//     private String slug;
// 
//     /**
//      * The date when the repository was created.
//      */
//     public Date getCreatedAt() {
//         return createdAt;
//     }
// 
//     /**
//      * A description of the repository, as entered by its creator.
//      */
//     public String getDescription() {
//         return description;
//     }
// 
//     /**
//      * When this repository was last updated.
//      * 
//      */
//     public Date getLastUpdatedOn() {
//         return lastUpdatedOn;
//     }
// 
//     /**
//      * A user friendly name for this repository (may differ from its
//      * {@link #getSlug() slug}).
//      * 
//      */
//     public String getName() {
//         return name;
//     }
// 
//     /**
//      * The username of the repository owner.
//      */
//     public String getOwner() {
//         return owner;
//     }
// 
//     /**
//      * The source control management system this repository uses.
//      */
//     public BitBucketSCM getScm() {
//         return scm;
//     }
// 
//     /**
//      * The size of this repository, in bytes.
//      */
//     public long getSize() {
//         return size;
//     }
// 
//     /**
//      * This repository's "slug", <i>ie.</i> its technical id in BitBucket terms.
//      */
//     public String getSlug() {
//         return slug;
//     }
// 
//     /**
//      * Whether this repository has an attached wiki.
//      */
//     public boolean isHasWiki() {
//         return hasWiki;
//     }
// 
//     /**
//      * Whether this repository is private (authenticated user needs access to
//      * it) or is for everyone to see.
//      */
//     public boolean isPrivate() {
//         return _private;
//     }
// 
//     public boolean isReadOnly() {
//         return readOnly;
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketSCM.java
// public enum BitBucketSCM {
// 
//     /**
//      * Mercurial.
//      */
//     hg,
// 
//     /**
//      * Git.
//      */
//     git;
// 
// }
// 
// Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketUser.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketUser implements Serializable {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @JsonProperty
//     private String username;
// 
//     @JsonProperty("first_name")
//     private String firstName;
// 
//     @JsonProperty("last_name")
//     private String lastName;
// 
//     @JsonProperty("avatar")
//     private String avatarImageUrl;
// 
//     public String getUsername() {
//         return username;
//     }
// 
//     public String getFirstName() {
//         return firstName;
//     }
// 
//     public String getLastName() {
//         return lastName;
//     }
// 
//     public String getAvatarImageUrl() {
//         return avatarImageUrl;
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/social/bitbucket/api/UserWithRepositories.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class UserWithRepositories {
// 
//     @JsonProperty
//     private BitBucketUser user;
// 
//     @JsonProperty
//     private List<BitBucketRepository> repositories;
// 
//     public List<BitBucketRepository> getRepositories() {
//         return repositories;
//     }
// 
//     public BitBucketUser getUser() {
//         return user;
//     }
// 
// }


import static org.junit.Assert.*;
import static org.springframework.http.HttpMethod.*;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
import static org.springframework.test.web.client.response.MockRestResponseCreators.*;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.TimeZone;
import org.junit.Test;
import org.springframework.http.MediaType;
import org.springframework.social.bitbucket.api.BitBucketRepository;
import org.springframework.social.bitbucket.api.BitBucketSCM;
import org.springframework.social.bitbucket.api.BitBucketUser;
import org.springframework.social.bitbucket.api.UserWithRepositories;
/**
 * Copyright 2012 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
 *
 *      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 org.springframework.social.bitbucket.api.impl;




public class UserTemplateTest extends BaseTemplateTest {

    @Test
    public void testGetUser() throws Exception {

        mockServer
                .expect(requestTo("https://api.bitbucket.org/1.0/user"))
                .andExpect(method(GET))
                .andRespond(
                        withSuccess(jsonResource("get-user"),
                                MediaType.APPLICATION_JSON));

// Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketRepository.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketRepository implements Serializable {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @JsonProperty("is_private")
//     private boolean _private;
// 
//     @JsonProperty("utc_created_on")
//     @JsonDeserialize(using = UTCDateDeserializer.class)
//     private Date createdAt;
// 
//     @JsonProperty
//     private String description;
// 
//     @JsonProperty("has_wiki")
//     private boolean hasWiki;
// 
//     @JsonProperty("utc_last_updated")
//     @JsonDeserialize(using = UTCDateDeserializer.class)
//     private Date lastUpdatedOn;
// 
//     @JsonProperty
//     private String name;
// 
//     @JsonProperty
//     private String owner;
// 
//     @JsonProperty("read_only")
//     private boolean readOnly;
// 
//     @JsonProperty
//     private BitBucketSCM scm;
// 
//     @JsonProperty
//     private long size;
// 
//     @JsonProperty
//     private String slug;
// 
//     /**
//      * The date when the repository was created.
//      */
//     public Date getCreatedAt() {
//         return createdAt;
//     }
// 
//     /**
//      * A description of the repository, as entered by its creator.
//      */
//     public String getDescription() {
//         return description;
//     }
// 
//     /**
//      * When this repository was last updated.
//      * 
//      */
//     public Date getLastUpdatedOn() {
//         return lastUpdatedOn;
//     }
// 
//     /**
//      * A user friendly name for this repository (may differ from its
//      * {@link #getSlug() slug}).
//      * 
//      */
//     public String getName() {
//         return name;
//     }
// 
//     /**
//      * The username of the repository owner.
//      */
//     public String getOwner() {
//         return owner;
//     }
// 
//     /**
//      * The source control management system this repository uses.
//      */
//     public BitBucketSCM getScm() {
//         return scm;
//     }
// 
//     /**
//      * The size of this repository, in bytes.
//      */
//     public long getSize() {
//         return size;
//     }
// 
//     /**
//      * This repository's "slug", <i>ie.</i> its technical id in BitBucket terms.
//      */
//     public String getSlug() {
//         return slug;
//     }
// 
//     /**
//      * Whether this repository has an attached wiki.
//      */
//     public boolean isHasWiki() {
//         return hasWiki;
//     }
// 
//     /**
//      * Whether this repository is private (authenticated user needs access to
//      * it) or is for everyone to see.
//      */
//     public boolean isPrivate() {
//         return _private;
//     }
// 
//     public boolean isReadOnly() {
//         return readOnly;
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketSCM.java
// public enum BitBucketSCM {
// 
//     /**
//      * Mercurial.
//      */
//     hg,
// 
//     /**
//      * Git.
//      */
//     git;
// 
// }
// 
// Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketUser.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketUser implements Serializable {
// 
//     private static final long serialVersionUID = 1L;
// 
//     @JsonProperty
//     private String username;
// 
//     @JsonProperty("first_name")
//     private String firstName;
// 
//     @JsonProperty("last_name")
//     private String lastName;
// 
//     @JsonProperty("avatar")
//     private String avatarImageUrl;
// 
//     public String getUsername() {
//         return username;
//     }
// 
//     public String getFirstName() {
//         return firstName;
//     }
// 
//     public String getLastName() {
//         return lastName;
//     }
// 
//     public String getAvatarImageUrl() {
//         return avatarImageUrl;
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/social/bitbucket/api/UserWithRepositories.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class UserWithRepositories {
// 
//     @JsonProperty
//     private BitBucketUser user;
// 
//     @JsonProperty
//     private List<BitBucketRepository> repositories;
// 
//     public List<BitBucketRepository> getRepositories() {
//         return repositories;
//     }
// 
//     public BitBucketUser getUser() {
//         return user;
//     }
// 
// }


// Path: src/test/java/org/springframework/social/bitbucket/api/impl/UserTemplateTest.java
import static org.junit.Assert.*;
import static org.springframework.http.HttpMethod.*;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
import static org.springframework.test.web.client.response.MockRestResponseCreators.*;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.TimeZone;
import org.junit.Test;
import org.springframework.http.MediaType;
import org.springframework.social.bitbucket.api.BitBucketRepository;
import org.springframework.social.bitbucket.api.BitBucketSCM;
import org.springframework.social.bitbucket.api.BitBucketUser;
import org.springframework.social.bitbucket.api.UserWithRepositories;

/**
 * Copyright 2012 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
 *
 *      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 org.springframework.social.bitbucket.api.impl;




public class UserTemplateTest extends BaseTemplateTest {

    @Test
    public void testGetUser() throws Exception {

        mockServer
                .expect(requestTo("https://api.bitbucket.org/1.0/user"))
                .andExpect(method(GET))
                .andRespond(
                        withSuccess(jsonResource("get-user"),
                                MediaType.APPLICATION_JSON));

        UserWithRepositories profile = bitBucket.userOperations()