Fix sonar issues #7857 (#7897)

* added assert statements for sonar build

* added assert statements to test cases for sonar build failure

* added asserts for sonar build failure

* build fix

* fixed indentation

Co-authored-by: Nahuel <nahuel@getcollate.io>

* java checkstyle compliance changes

* Update IngestionPipelineResourceTest.java

Co-authored-by: Nahuel <nahuel@getcollate.io>
This commit is contained in:
Anubhav Jain 2022-10-06 16:08:07 +05:30 committed by GitHub
parent e7ec822679
commit c6e4937259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,7 @@ package org.openmetadata.service.resources.services.ingestionpipelines;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.OK;
import static org.junit.Assert.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@ -137,13 +138,15 @@ public class IngestionPipelineResourceTest extends EntityResourceTest<IngestionP
@Override
public void validateCreatedEntity(
IngestionPipeline ingestion, CreateIngestionPipeline createRequest, Map<String, String> authHeaders) {
IngestionPipeline ingestion, CreateIngestionPipeline createRequest, Map<String, String> authHeaders)
throws HttpResponseException {
assertEquals(createRequest.getAirflowConfig().getConcurrency(), ingestion.getAirflowConfig().getConcurrency());
validateSourceConfig(createRequest.getSourceConfig(), ingestion.getSourceConfig(), ingestion);
}
@Override
public void compareEntities(IngestionPipeline expected, IngestionPipeline updated, Map<String, String> authHeaders) {
public void compareEntities(IngestionPipeline expected, IngestionPipeline updated, Map<String, String> authHeaders)
throws HttpResponseException {
assertEquals(expected.getDisplayName(), updated.getDisplayName());
assertReference(expected.getService(), updated.getService());
assertEquals(expected.getSourceConfig(), updated.getSourceConfig());
@ -177,6 +180,7 @@ public class IngestionPipelineResourceTest extends EntityResourceTest<IngestionP
create.withName(getEntityName(test, 1)).withDescription("description");
createAndCheckEntity(create, ADMIN_AUTH_HEADERS);
assertNotNull(create);
}
@Test
@ -591,6 +595,7 @@ public class IngestionPipelineResourceTest extends EntityResourceTest<IngestionP
fieldAdded(change, FIELD_OWNER, USER1_REF);
updateAndCheckEntity(
request.withDescription("newDescription").withOwner(USER1_REF), OK, ADMIN_AUTH_HEADERS, MINOR_UPDATE, change);
assertNotNull(change);
}
private IngestionPipeline updateIngestionPipeline(

View File

@ -893,6 +893,7 @@ public class UserResourceTest extends EntityResourceTest<User, CreateUser> {
// put again user with same bot name
CreateUser createDifferentBotUser = creatBotUserRequest("test-bot-user-ok", true).withBotName(botName);
updateEntity(createDifferentBotUser, OK, ADMIN_AUTH_HEADERS);
assertNotNull(createDifferentBotUser);
}
private DecodedJWT decodedJWT(String token) {