Skip to content

Commit

Permalink
#2748: Provider should disable mock configuration (#2750)
Browse files Browse the repository at this point in the history
  • Loading branch information
beiwei30 authored Nov 7, 2018
1 parent ef4ecdf commit d6aae07
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,16 @@ public void setGeneric(String generic) {
}
}

@Override
public void setMock(Boolean mock) {
throw new IllegalArgumentException("mock doesn't support on provider side");
}

@Override
public void setMock(String mock) {
throw new IllegalArgumentException("mock doesn't support on provider side");
}

public List<URL> getExportedUrls() {
return urls;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,18 @@ public void testGeneric2() throws Exception {
service.setGeneric("illegal");
}

@Test(expected = IllegalArgumentException.class)
public void testMock() throws Exception {
ServiceConfig service = new ServiceConfig();
service.setMock("true");
}

@Test(expected = IllegalArgumentException.class)
public void testMock2() throws Exception {
ServiceConfig service = new ServiceConfig();
service.setMock(true);
}

@Test
public void testUniqueServiceName() throws Exception {
ServiceConfig<Greeting> service = new ServiceConfig<Greeting>();
Expand Down

0 comments on commit d6aae07

Please sign in to comment.