changed formatter
This commit is contained in:
@@ -23,7 +23,8 @@ public class HomeboxConnectionProvider implements ConnectionProvider {
|
||||
|
||||
private final ConnectionRepository cRepository;
|
||||
|
||||
public HomeboxConnectionProvider(RestClient.Builder restClientBuilder, ConnectionRepository cRepository) {
|
||||
public HomeboxConnectionProvider(RestClient.Builder restClientBuilder,
|
||||
ConnectionRepository cRepository) {
|
||||
this.restClientBuilder = restClientBuilder;
|
||||
this.cRepository = cRepository;
|
||||
}
|
||||
@@ -51,20 +52,16 @@ public class HomeboxConnectionProvider implements ConnectionProvider {
|
||||
|
||||
@Override
|
||||
public ConnectionResponse authenticate(ConnectionRequest request) {
|
||||
Map<String, Object> homeboxPayload = Map.of("username", request.username(),
|
||||
"password", request.password(), "stayLoggedIn",
|
||||
request.stayLoggedIn());
|
||||
Map<String, Object> homeboxPayload = Map.of("username", request.username(), "password",
|
||||
request.password(), "stayLoggedIn", request.stayLoggedIn());
|
||||
|
||||
HomeboxLoginResponse hbResponse = restClientBuilder.baseUrl(request.appUrl())
|
||||
.build()
|
||||
.post()
|
||||
.uri(HOMEBOX_LOGIN.getValue())
|
||||
.body(homeboxPayload)
|
||||
.retrieve()
|
||||
HomeboxLoginResponse hbResponse = restClientBuilder.baseUrl(request.appUrl()).build().post()
|
||||
.uri(HOMEBOX_LOGIN.getValue()).body(homeboxPayload).retrieve()
|
||||
.body(HomeboxLoginResponse.class);
|
||||
|
||||
if (hbResponse == null) {
|
||||
throw new IllegalStateException("Remote API returned an empty body for " + request.appUrl());
|
||||
throw new IllegalStateException(
|
||||
"Remote API returned an empty body for " + request.appUrl());
|
||||
}
|
||||
|
||||
Map<String, Object> attachmentToken = new HashMap<>();
|
||||
@@ -81,7 +78,8 @@ public class HomeboxConnectionProvider implements ConnectionProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConnectionEntity connectionToEntity(ConnectionRequest request, ConnectionResponse response) {
|
||||
public ConnectionEntity connectionToEntity(ConnectionRequest request,
|
||||
ConnectionResponse response) {
|
||||
return HomeboxEntity.from(request, response);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user