Skip to content

Commit

Permalink
Fix sonarcloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
forus committed Jun 27, 2024
1 parent 6f86eeb commit 90fdb3e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.mongodb.BasicDBObject;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.cbioportal.web.PublicVirtualStudiesController;
import org.cbioportal.web.parameter.VirtualStudy;
import org.cbioportal.web.parameter.VirtualStudyData;
import org.slf4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public ResponseEntity<VirtualStudy> publishVirtualStudy(

@DeleteMapping("/{id}")
@ApiResponse(responseCode = "200", description = "OK")
public ResponseEntity retractVirtualStudy(
public ResponseEntity<?> retractVirtualStudy(
@PathVariable String id,
@RequestHeader(value = "X-PUBLISHER-API-KEY") String providedPublisherApiKey
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,33 @@
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class PublicVirtualStudiesIntegrationTest extends ContainerConfig {

final static String CBIO_URL = String.format("http://localhost:%d", CBIO_PORT);
static final String CBIO_URL = String.format("http://localhost:%d", CBIO_PORT);

final static HttpHeaders jsonContentType = new HttpHeaders() {
static final HttpHeaders jsonContentType = new HttpHeaders() {
{
set("Content-Type", "application/json");
}
};
final static HttpHeaders invalidKeyContainingHeaders = new HttpHeaders() {

static final HttpHeaders invalidKeyContainingHeaders = new HttpHeaders() {
{
set("X-PUBLISHER-API-KEY", "this-is-not-valid-key");
}
};
final static HttpHeaders validKeyContainingHeaders = new HttpHeaders() {

static final HttpHeaders validKeyContainingHeaders = new HttpHeaders() {
{
set("X-PUBLISHER-API-KEY", "this-is-a-secret");
}
};
final static ParameterizedTypeReference<List<VirtualStudy>> typeRef = new ParameterizedTypeReference<>() {

static final ParameterizedTypeReference<List<VirtualStudy>> typeRef = new ParameterizedTypeReference<>() {
};

static String createdVsId;
static String publishedVsId;

final static VirtualStudyData virtualStudyDataToSave = createTestVsData();
static final VirtualStudyData virtualStudyDataToSave = createTestVsData();

@Autowired
private TestRestTemplate restTemplate;
Expand All @@ -93,7 +93,7 @@ public void test1NoPublicVirtualStudiesAtTheBeginning() {
typeRef);

assertThat(response1.getStatusCode().is2xxSuccessful()).isTrue();
assertThat(response1.getBody()).hasSize(0);
assertThat(response1.getBody()).isEmpty();
}

@Test
Expand Down Expand Up @@ -193,7 +193,7 @@ public void test6NoPublicVirtualStudiesAfterRemoval() {
typeRef);

assertThat(response6.getStatusCode().is2xxSuccessful()).isTrue();
assertThat(response6.getBody()).hasSize(0);
assertThat(response6.getBody()).isEmpty();
}

static VirtualStudyData createTestVsData() {
Expand Down

0 comments on commit 90fdb3e

Please sign in to comment.