diff options
author | Nelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com> | 2019-01-29 15:55:37 -0500 |
---|---|---|
committer | Nelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com> | 2019-01-29 16:05:01 -0500 |
commit | a27be9fdbbf2d271c9c5780ba70fe15a24dbdb63 (patch) | |
tree | 1fa631eae149ed6be33b636e7eac03dadbef64c3 /src/test/java/org/onap/music/exceptions/MusicExceptionMapperTest.java | |
parent | 95489883ce973e84267fcbcee685f1598d4bdd6e (diff) |
Push variuos changes
- Spring Boot
- Cadi
- Cassandra Locking
Change-Id: Ie9882f81f0ca141bdb7862cdabf978481fcd7c4a
Issue-ID: MUSIC-296,MUSIC-272
Signed-off-by: Nelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>
Diffstat (limited to 'src/test/java/org/onap/music/exceptions/MusicExceptionMapperTest.java')
-rw-r--r-- | src/test/java/org/onap/music/exceptions/MusicExceptionMapperTest.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/test/java/org/onap/music/exceptions/MusicExceptionMapperTest.java b/src/test/java/org/onap/music/exceptions/MusicExceptionMapperTest.java index bbfa9832..58135551 100644 --- a/src/test/java/org/onap/music/exceptions/MusicExceptionMapperTest.java +++ b/src/test/java/org/onap/music/exceptions/MusicExceptionMapperTest.java @@ -25,8 +25,8 @@ package org.onap.music.exceptions; import org.codehaus.jackson.map.exc.UnrecognizedPropertyException; import org.junit.Test; import org.junit.runner.RunWith; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.modules.junit4.PowerMockRunner; +import org.mockito.Mockito; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import javax.ws.rs.core.Response; import java.io.EOFException; @@ -34,25 +34,26 @@ import java.util.Map; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; -@RunWith(PowerMockRunner.class) +@RunWith(SpringJUnit4ClassRunner.class) public class MusicExceptionMapperTest { @Test public void testToResponse() { MusicExceptionMapper musicExceptionMapper = new MusicExceptionMapper(); - UnrecognizedPropertyException unrecognizedPropertyException = PowerMockito.mock(UnrecognizedPropertyException.class); + UnrecognizedPropertyException unrecognizedPropertyException = mock(UnrecognizedPropertyException.class); Response response = musicExceptionMapper.toResponse(unrecognizedPropertyException); assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); assertTrue(((Map)response.getEntity()).get("error").toString().startsWith("Unknown field :")); - EOFException eofException = PowerMockito.mock(EOFException.class); + EOFException eofException = mock(EOFException.class); response = musicExceptionMapper.toResponse(eofException); assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); assertTrue(((Map)response.getEntity()).get("error").toString().equals("Request body cannot be empty".trim())); - IllegalArgumentException illegalArgumentException = PowerMockito.mock(IllegalArgumentException.class); - PowerMockito.when(illegalArgumentException.getMessage()).thenReturn("ERROR MSG"); + IllegalArgumentException illegalArgumentException = mock(IllegalArgumentException.class); + Mockito.when(illegalArgumentException.getMessage()).thenReturn("ERROR MSG"); response = musicExceptionMapper.toResponse(illegalArgumentException); assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus()); assertTrue(((Map)response.getEntity()).get("error").toString().equals("ERROR MSG".trim())); |