FINERACT-2081: Integration test clean up - Remove Google truth dependency and Extract Fineract client out from IntegrationTest class
This commit is contained in:
@@ -40,4 +40,6 @@ dependencies {
|
||||
exclude group: 'org.apache.oltu.oauth2', module: 'org.apache.oltu.oauth2.common'
|
||||
exclude group: 'org.slf4j'
|
||||
}
|
||||
|
||||
testImplementation 'org.assertj:assertj-core'
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.apache.fineract.client.util;
|
||||
|
||||
import com.google.common.truth.Truth;
|
||||
import com.google.common.truth.Truth8;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import okhttp3.Headers;
|
||||
import okhttp3.MediaType;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -29,32 +29,32 @@ public class PartsTest {
|
||||
|
||||
@Test
|
||||
void validMediaType() {
|
||||
Truth.assertThat(Parts.mediaType("test.jpg")).isEqualTo(MediaType.get("image/jpeg"));
|
||||
assertThat(Parts.mediaType("test.jpg")).isEqualTo(MediaType.get("image/jpeg"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void dotMediaType() {
|
||||
Truth.assertThat(Parts.mediaType("test.")).isNull();
|
||||
assertThat(Parts.mediaType("test.")).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void emptyMediaType() {
|
||||
Truth.assertThat(Parts.mediaType("")).isNull();
|
||||
assertThat(Parts.mediaType("")).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void nullMediaType() {
|
||||
Truth.assertThat(Parts.mediaType(null)).isNull();
|
||||
assertThat(Parts.mediaType(null)).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void fileName() {
|
||||
Truth8.assertThat(Parts.fileName(Response.success(null, Headers.of("Content-Disposition", "attachment; filename=\"doc.pdf\""))))
|
||||
assertThat(Parts.fileName(Response.success(null, Headers.of("Content-Disposition", "attachment; filename=\"doc.pdf\""))))
|
||||
.hasValue("doc.pdf");
|
||||
}
|
||||
|
||||
@Test
|
||||
void fileNameWithoutContentDisposition() {
|
||||
Truth8.assertThat(Parts.fileName(Response.success(null))).isEmpty();
|
||||
assertThat(Parts.fileName(Response.success(null))).isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user