Skip to content

Commit

Permalink
Minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rma-rripken committed Jul 25, 2024
1 parent 842ad77 commit 0796cae
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void test_ctor() {
ContentType ct = new ContentType("application/json");
assertEquals("application/json", ct.getType());
Map<String, String> parameters = ct.getParameters();
assertTrue(parameters==null || parameters.isEmpty());
assertTrue(parameters == null || parameters.isEmpty());
}

@Test
Expand All @@ -28,44 +28,44 @@ void test_ctor_null() {
void test_ctor_empty() {
ContentType ct = new ContentType("");
Map<String, String> parameters = ct.getParameters();
assertTrue(parameters==null || parameters.isEmpty());
assertTrue(parameters == null || parameters.isEmpty());
assertNull(ct.getCharset());
}

@Test
void test_ctor_garbage() {
ContentType ct = new ContentType("qawicxqyjx");
Map<String, String> parameters = ct.getParameters();
assertTrue(parameters==null || parameters.isEmpty());
assertTrue(parameters == null || parameters.isEmpty());
assertNull(ct.getCharset());
}


@Test
void test_ctor_w_charset(){
void test_ctor_w_charset() {
ContentType ct = new ContentType("application/json;charset=UTF-8");
assertEquals("application/json", ct.getType());
Map<String, String> parameters = ct.getParameters();
assertTrue(parameters==null || parameters.isEmpty());
assertTrue(parameters == null || parameters.isEmpty());
assertEquals("UTF-8", ct.getCharset());
}

@Test
void test_ctor_w_charset_space(){
void test_ctor_w_charset_space() {
ContentType ct = new ContentType("application/json; charset=UTF-8");
assertEquals("application/json", ct.getType());
Map<String, String> parameters = ct.getParameters();
assertTrue(parameters==null || parameters.isEmpty());
assertTrue(parameters == null || parameters.isEmpty());

assertEquals("UTF-8", ct.getCharset());
}


@ParameterizedTest
@CsvSource(value = {
"application/json;charset=utf-8|application/json;",
"application/json;version=2,charset=utf-8|application/json;version=2"
},delimiter='|')
"application/json;charset=utf-8|application/json;",
"application/json;version=2,charset=utf-8|application/json;version=2"
}, delimiter = '|')
void test_equals_and_equivalent(String a, String b) {
ContentType aCt = new ContentType(a);
ContentType bCt = new ContentType(b);
Expand Down

0 comments on commit 0796cae

Please sign in to comment.