Skip to content

Commit

Permalink
Merge pull request #3019 from yurake/feature
Browse files Browse the repository at this point in the history
Feature
  • Loading branch information
yurake authored Feb 7, 2023
2 parents db0ea9a + 4b8a37c commit 40fb6cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public MsgBean getMsg(HazelcastInstance client) {
}
} catch (IllegalStateException e) {
logger.log(Level.SEVERE, "Get Error.", e);
e.printStackTrace();
} finally {
if (client != null) {
client.shutdown();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package webapp.tier.service;

import java.security.NoSuchAlgorithmException;
import java.util.Objects;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down Expand Up @@ -38,12 +39,11 @@ public MemCachedClient createMemCachedClient() {
return new MemCachedClient();
}

public MsgBean setMsg(MemCachedClient mcc) {
public MsgBean setMsg(MemCachedClient mcc) throws NoSuchAlgorithmException {

MsgBean msgbean = null;
MsgBean msgbean = new MsgBean(CreateId.createid(), message);
String errormsg = "Set Error.";
try {
msgbean = new MsgBean(CreateId.createid(), message);
Objects.requireNonNull(msgbean);
boolean resultsetid = mcc.set("id", String.valueOf(msgbean.getId()));
boolean resultsetmsg = mcc.set("msg", msgbean.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.when;

import java.security.NoSuchAlgorithmException;

import org.junit.jupiter.api.Test;
import org.mockito.ArgumentMatchers;

Expand All @@ -18,7 +20,7 @@ class MemcachedResourceErrorTest {
MemcachedService svc;

@Test
void testSetError() {
void testSetError() throws NoSuchAlgorithmException {
try {
when(svc.setMsg(ArgumentMatchers.any())).thenThrow(new RuntimeException());
} catch (RuntimeException e) {
Expand Down

0 comments on commit 40fb6cf

Please sign in to comment.