Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.

Commit

Permalink
(#155) Remove "Login" from all *Login implementations (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
llorllale committed Jan 21, 2018
1 parent c6ef0d4 commit d480e45
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 44 deletions.
Expand Up @@ -34,7 +34,7 @@
* @author George Aristy (george.aristy@gmail.com)
* @since 0.1.0
*/
public final class AnonymousLogin implements Login {
public final class Anonymous implements Login {
private final URL youtrackUrl;

/**
Expand All @@ -43,7 +43,7 @@ public final class AnonymousLogin implements Login {
* @param youtrackUrl the YouTrack API's url.
* @since 0.1.0
*/
public AnonymousLogin(URL youtrackUrl) {
public Anonymous(URL youtrackUrl) {
this.youtrackUrl = youtrackUrl;
}

Expand Down
Expand Up @@ -26,7 +26,7 @@
* @author George Aristy (george.aristy@gmail.com)
* @since 0.3.0
*/
public final class PermanentTokenLogin implements Login {
public final class PermanentToken implements Login {
private final URL youtrackUrl;
private final String token;

Expand All @@ -37,7 +37,7 @@ public final class PermanentTokenLogin implements Login {
* @param token the YouTrack user's permanent token
* @since 0.3.0
*/
public PermanentTokenLogin(URL youtrackUrl, String token) {
public PermanentToken(URL youtrackUrl, String token) {
this.youtrackUrl = youtrackUrl;
this.token = token;
}
Expand Down
Expand Up @@ -35,7 +35,7 @@
* @see Login
* @since 0.1.0
*/
public final class UsernamePasswordLogin implements Login {
public final class UsernamePassword implements Login {
private final URL youtrackUrl;
private final HttpClient httpClient;
private final String username;
Expand All @@ -50,7 +50,7 @@ public final class UsernamePasswordLogin implements Login {
* @param httpClient http client to use to call the remote API
* @since 0.1.0
*/
UsernamePasswordLogin(
UsernamePassword(
final URL youtrackUrl,
String username,
char[] password,
Expand All @@ -71,7 +71,7 @@ public final class UsernamePasswordLogin implements Login {
* @see #UsernamePasswordLogin(URL, String, char[], HttpClient)
* @since 0.1.0
*/
public UsernamePasswordLogin(
public UsernamePassword(
final URL youtrackUrl,
String username,
char[] password
Expand Down
Expand Up @@ -21,7 +21,7 @@
import static org.junit.Assert.assertThat;
import org.junit.BeforeClass;
import org.junit.Test;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -38,7 +38,7 @@ public class DefaultCommentsIT {
public static void setup() throws Exception {
config = new IntegrationTestsConfig();

session = new PermanentTokenLogin(
session = new PermanentToken(
config.youtrackUrl(),
config.youtrackUserToken()
).login();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/llorllale/youtrack/api/DefaultFieldsIT.java
Expand Up @@ -21,7 +21,7 @@
import static org.junit.Assert.assertThat;
import org.junit.BeforeClass;
import org.junit.Test;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -37,7 +37,7 @@ public class DefaultFieldsIT {
@BeforeClass
public static void setup() throws Exception {
final IntegrationTestsConfig config = new IntegrationTestsConfig();
session = new PermanentTokenLogin(config.youtrackUrl(), config.youtrackUserToken()).login();
session = new PermanentToken(config.youtrackUrl(), config.youtrackUserToken()).login();
project = new DefaultYouTrack(session).projects().stream().findAny().get();
}

Expand Down
Expand Up @@ -23,7 +23,7 @@
import static org.junit.Assert.assertTrue;
import org.junit.BeforeClass;
import org.junit.Test;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -39,7 +39,7 @@ public class DefaultIssueTimeTrackingIT {
public static void setup() throws Exception {
config = new IntegrationTestsConfig();

session = new PermanentTokenLogin(
session = new PermanentToken(
config.youtrackUrl(),
config.youtrackUserToken()
).login();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/llorllale/youtrack/api/DefaultIssuesIT.java
Expand Up @@ -19,7 +19,7 @@
import static org.junit.Assert.assertTrue;
import org.junit.BeforeClass;
import org.junit.Test;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -35,7 +35,7 @@ public class DefaultIssuesIT {
@BeforeClass
public static void setup() throws Exception {
config = new IntegrationTestsConfig();
session = new PermanentTokenLogin(
session = new PermanentToken(
config.youtrackUrl(),
config.youtrackUserToken()
).login();
Expand Down
Expand Up @@ -22,7 +22,7 @@
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.BeforeClass;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -38,7 +38,7 @@ public class DefaultProjectTimeTrackingIT {
@BeforeClass
public static void setup() throws Exception {
final IntegrationTestsConfig config = new IntegrationTestsConfig();
session = new PermanentTokenLogin(config.youtrackUrl(), config.youtrackUserToken()).login();
session = new PermanentToken(config.youtrackUrl(), config.youtrackUserToken()).login();
project = new DefaultYouTrack(session).projects().stream().findAny().get();
}

Expand Down
Expand Up @@ -21,7 +21,7 @@
import static org.junit.Assert.assertTrue;
import org.junit.BeforeClass;
import org.junit.Test;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -36,7 +36,7 @@ public class DefaultProjectsIT {
@BeforeClass
public static void setup() throws Exception {
config = new IntegrationTestsConfig();
session = new PermanentTokenLogin(
session = new PermanentToken(
config.youtrackUrl(),
config.youtrackUserToken()
).login();
Expand Down
Expand Up @@ -20,7 +20,7 @@
import static org.junit.Assert.assertNotEquals;
import org.junit.Test;
import org.junit.BeforeClass;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -37,7 +37,7 @@ public class DefaultUpdateIssueIT {
@BeforeClass
public static void setup() throws Exception {
config = new IntegrationTestsConfig();
session = new PermanentTokenLogin(config.youtrackUrl(), config.youtrackUserToken()).login();
session = new PermanentToken(config.youtrackUrl(), config.youtrackUserToken()).login();
issue = new DefaultYouTrack(session).projects().stream()
.findAny()
.get()
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/llorllale/youtrack/api/XmlCommentIT.java
Expand Up @@ -20,7 +20,7 @@
import static org.junit.Assert.assertTrue;
import org.junit.BeforeClass;
import org.junit.Test;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -36,7 +36,7 @@ public class XmlCommentIT {
@BeforeClass
public static void setUpClass() throws Exception {
final IntegrationTestsConfig config = new IntegrationTestsConfig();
session = new PermanentTokenLogin(
session = new PermanentToken(
config.youtrackUrl(),
config.youtrackUserToken()
).login();
Expand Down
Expand Up @@ -21,7 +21,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.llorllale.youtrack.api.mock.MockUser;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -37,7 +37,7 @@ public class XmlUsersOfIssueIT {
public static void setup() throws Exception {
config = new IntegrationTestsConfig();

session = new PermanentTokenLogin(
session = new PermanentToken(
config.youtrackUrl(),
config.youtrackUserToken()
).login();
Expand Down
Expand Up @@ -21,7 +21,7 @@
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.BeforeClass;
import org.llorllale.youtrack.api.session.PermanentTokenLogin;
import org.llorllale.youtrack.api.session.PermanentToken;
import org.llorllale.youtrack.api.session.Session;

/**
Expand All @@ -38,7 +38,7 @@ public class XmlUsersOfProjectIT {
@BeforeClass
public static void setup() throws Exception {
config = new IntegrationTestsConfig();
session = new PermanentTokenLogin(config.youtrackUrl(), config.youtrackUserToken()).login();
session = new PermanentToken(config.youtrackUrl(), config.youtrackUserToken()).login();
project = new DefaultYouTrack(session).projects().stream().findAny().get();
}

Expand Down
Expand Up @@ -21,15 +21,15 @@
import org.junit.Test;

/**
* Unit tests for {@link AnonymousLogin}.
* Unit tests for {@link Anonymous}.
* @author George Aristy (george.aristy@gmail.com)
* @since 0.4.0
*/
public class AnonymousLoginTest {
public class AnonymousTest {
@Test
public void login() throws Exception {
assertNotNull(
new AnonymousLogin(
new Anonymous(
new URL("http://some.url")
).login()
);
Expand Down
Expand Up @@ -22,16 +22,16 @@
import org.junit.Test;

/**
* Unit tests for {@link PermanentTokenLogin}.
* Unit tests for {@link PermanentToken}.
* @author George Aristy (george.aristy@gmail.com)
* @since 0.4.0
*/
public class PermanentTokenLoginTest {
public class PermanentTokenTest {
@Test
public void login() throws Exception {
final String token = "abc123";
assertNotNull(
new PermanentTokenLogin(
new PermanentToken(
new URL("http://some.url"),
token
).login()
Expand All @@ -43,7 +43,7 @@ public void loginHeader() throws Exception {
final String token = "abc123";

assertTrue(
new PermanentTokenLogin(
new PermanentToken(
new URL("http://some.url"),
token
).login()
Expand Down
Expand Up @@ -24,17 +24,17 @@
import org.llorllale.youtrack.api.IntegrationTestsConfig;

/**
* Integration tests for {@link UsernamePasswordLogin}.
* Integration tests for {@link UsernamePassword}.
* @author George Aristy (george.aristy@gmail.com)
* @since 0.4.0
*/
public class UsernamePasswordLoginIT {
public class UsernamePasswordIT {
@Test
public void login() throws Exception {
final IntegrationTestsConfig config = new IntegrationTestsConfig();

assertThat(
new UsernamePasswordLogin(
new UsernamePassword(
config.youtrackUrl(),
config.youtrackUser(),
config.youtrackPwd()
Expand All @@ -53,7 +53,7 @@ public void login() throws Exception {
@Test
public void multipleLogins() throws Exception {
final IntegrationTestsConfig config = new IntegrationTestsConfig();
final Login login = new UsernamePasswordLogin(
final Login login = new UsernamePassword(
config.youtrackUrl(),
config.youtrackUser(),
config.youtrackPwd()
Expand Down
Expand Up @@ -26,11 +26,11 @@
import org.llorllale.youtrack.api.mock.http.response.MockOkResponse;

/**
* Unit tests for {@link UsernamePasswordLogin}.
* Unit tests for {@link UsernamePassword}.
* @author George Aristy (george.aristy@gmail.com)
* @since 0.4.0
*/
public class UsernamePasswordLoginTest {
public class UsernamePasswordTest {

/**
* Login should be successful if remote API response is 200
Expand All @@ -41,7 +41,7 @@ public class UsernamePasswordLoginTest {
@Test
public void successfulLogin() throws Exception {
assertNotNull(
new UsernamePasswordLogin(
new UsernamePassword(
new URL("http://some.url"),
"test",
"123".toCharArray(),
Expand All @@ -62,7 +62,7 @@ public void successfulLogin() throws Exception {
*/
@Test(expected = AuthenticationException.class)
public void authenticationError() throws Exception {
new UsernamePasswordLogin(
new UsernamePassword(
new URL("http://some.url"),
"test",
"123".toCharArray(),
Expand All @@ -80,7 +80,7 @@ public void authenticationError() throws Exception {
@Test
public void correctHandlingOfCookieNames() throws Exception {
assertTrue(
new UsernamePasswordLogin(
new UsernamePassword(
new URL("http://some.url"),
"test",
"test123".toCharArray(),
Expand Down Expand Up @@ -111,7 +111,7 @@ public void correctHandlingOfCookieNames() throws Exception {
@Test
public void correctHandlingOfCookieValues() throws Exception {
assertTrue(
new UsernamePasswordLogin(
new UsernamePassword(
new URL("http://some.url"),
"test",
"test123".toCharArray(),
Expand Down

0 comments on commit d480e45

Please sign in to comment.