Skip to content
This repository was archived by the owner on Sep 21, 2020. It is now read-only.

Commit 42dbbc5

Browse files
committed
1 parent 716ee67 commit 42dbbc5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/test/java/com/opower/unitsofmeasure/TestUnitJacksonModule.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import javax.measure.Unit;
2121

22+
import static tec.uom.se.AbstractUnit.ONE;
2223
import static tec.uom.se.unit.MetricPrefix.KILO;
2324
import static tec.uom.se.unit.MetricPrefix.MILLI;
2425
import static org.junit.Assert.*;
@@ -84,6 +85,12 @@ public void testParseTemperature() throws Exception {
8485
Unit<?> parsedUnit = parse("\"Cel\"", Unit.class);
8586
assertEquals("The Unit<Temperature> in the parsed JSON doesn't match", Units.CELSIUS, parsedUnit);
8687
}
88+
89+
@Test
90+
public void testParseTemperatureInverse() throws Exception {
91+
Unit<?> parsedUnit = parse("\"1/K\"", Unit.class);
92+
assertEquals("The Unit<Temperature> in the parsed JSON doesn't match", ONE.divide(Units.KELVIN), parsedUnit);
93+
}
8794

8895
@Test
8996
public void testParseLength() throws Exception {

0 commit comments

Comments
 (0)