Skip to content

Commit

Permalink
secureCodeBox#121 Remove Unused field from Intermediate Class
Browse files Browse the repository at this point in the history
Signed-off-by: Sven Strittmatter <[email protected]>
  • Loading branch information
Weltraumschaf committed Jul 3, 2024
1 parent 814d455 commit f5ff0ae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package io.securecodebox.persistence.defectdojo.http;

import io.securecodebox.persistence.defectdojo.config.Config;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpHost;
Expand All @@ -18,12 +17,10 @@
*/
@Slf4j
public final class Foo {
private final Config config;
private final ProxyConfig proxyConfig;

public Foo(@NonNull final Config config, @NonNull final ProxyConfig proxyConfig) {
public Foo(@NonNull ProxyConfig proxyConfig) {
super();
this.config = config;
this.proxyConfig = proxyConfig;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private HttpHeaders getDefectDojoAuthorizationHeaders() {
}

private RestTemplate setupRestTemplate() {
RestTemplate restTemplate = new Foo(config, new ProxyConfigFactory().create()).createRestTemplate();
RestTemplate restTemplate = new Foo(new ProxyConfigFactory().create()).createRestTemplate();
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
converter.setObjectMapper(this.objectMapper);
restTemplate.setMessageConverters(List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private HttpHeaders getDefectDojoAuthorizationHeaders() {
}

protected RestTemplate setupRestTemplate() {
return new Foo(config, new ProxyConfigFactory().create()).createRestTemplate();
return new Foo(new ProxyConfigFactory().create()).createRestTemplate();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
* Tests for {@link Foo}
*/
class FooTest {
private final Config config = new Config("url", "apikey");
private final ProxyConfig proxyConfig = ProxyConfig.builder()
.user("user")
.password("pw")
.host("host")
.port(42)
.build();
private final Foo sut = new Foo(config, proxyConfig);
private final Foo sut = new Foo(proxyConfig);



Expand Down

0 comments on commit f5ff0ae

Please sign in to comment.