Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
## [3.0.0-RC3-SNAPSHOT]
### Changed
- `pl.smsapi.BasicAuthClient` marked as deprecated
- non-proxy action factories marked as deprecated

### Removed
- deprecated `pl.smsapi.proxy.Proxy#execute` method
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/pl/smsapi/api/ActionFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ public abstract class ActionFactory {
protected Client client;
protected Proxy proxy;

/**
* @deprecated use {@link ActionFactory(Client, Proxy)} instead
*/
@Deprecated
public ActionFactory() {
this.proxy = new ProxyNative("https://api.smsapi.pl/");
}

/**
* @deprecated use {@link ActionFactory(Client, Proxy)} instead
*/
@Deprecated
public ActionFactory(Client client) {
this.client = client;
this.proxy = new ProxyNative("https://api.smsapi.pl/");
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/pl/smsapi/api/ContactsFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

public class ContactsFactory extends ActionFactory {

/**
* @deprecated use {@link ContactsFactory(Client, Proxy)} instead
*/
@Deprecated
public ContactsFactory(Client client) {
super(client);
this.proxy = new ProxyNative("https://api.smsapi.pl/contacts/");
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/pl/smsapi/api/MmsFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

public class MmsFactory extends ActionFactory {

/**
* @deprecated use {@link MmsFactory(Client, Proxy)} instead
*/
@Deprecated
public MmsFactory(Client client) {
super(client);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/pl/smsapi/api/SenderFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

public class SenderFactory extends ActionFactory {

/**
* @deprecated use {@link SenderFactory(Client, Proxy)} instead
*/
@Deprecated
public SenderFactory(Client client) {
super(client);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/pl/smsapi/api/SmsFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

public class SmsFactory extends ActionFactory {

/**
* @deprecated use {@link SmsFactory(Client, Proxy)} instead
*/
@Deprecated
public SmsFactory(Client client) {
super(client);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/pl/smsapi/api/UserFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

public class UserFactory extends ActionFactory {

/**
* @deprecated use {@link UserFactory(Client, Proxy)} instead
*/
@Deprecated
public UserFactory(Client client) {
super(client);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/pl/smsapi/api/VmsFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

public class VmsFactory extends ActionFactory {

/**
* @deprecated use {@link VmsFactory(Client, Proxy)} instead
*/
@Deprecated
public VmsFactory(Client client) {
super(client);
}
Expand Down
8 changes: 7 additions & 1 deletion src/test/java/pl/smsapi/test/run/ContactsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import pl.smsapi.api.response.RawResponse;
import pl.smsapi.api.response.contacts.*;
import pl.smsapi.exception.SmsapiException;
import pl.smsapi.proxy.Proxy;
import pl.smsapi.proxy.ProxyNative;
import pl.smsapi.test.TestSmsapi;

import java.util.List;
Expand All @@ -30,14 +32,18 @@ public class ContactsTest extends TestSmsapi {

@Before
public void before() throws SmsapiException {
apiFactory = new ContactsFactory(getAuthorizationClient());
apiFactory = new ContactsFactory(getAuthorizationClient(), getProxy());

deleteTestData();

testContact = createTestContact();
testGroup = createTestGroup();
}

protected Proxy getProxy() {
return new ProxyNative("http://api.smsapi.pl/contacts/");
}

@After
public void after() throws SmsapiException {
deleteTestData();
Expand Down