Skip to content

Commit

Permalink
[wundergroundupdatereceiver] Re-case test method names
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Demus <daniel-github@demus.dk>
  • Loading branch information
danieldemus committed Jun 19, 2022
1 parent 1e1be51 commit d0997b2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private static String guessItemType(String value) {
}

private ChannelType addChannelType(ChannelTypeUID channelTypeUID, ChannelType channelType) {
logger.info("Adding channelType {} for unknown parameter", channelTypeUID.getAsString());
logger.warn("Adding channelType {} for unknown parameter", channelTypeUID.getAsString());
this.channelTypes.put(channelTypeUID, channelType);
return channelType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void setUp() {
}

@Test
void a_request_with_an_unregistered_stationid_is_added_to_the_queue_once()
void aRequestWithAnUnregisteredStationidIsAddedToTheQueueOnce()
throws ServletException, NamespaceException, IOException {
// Given
final String queryString = "ID=dfggger&" + "PASSWORD=XXXXXX&" + "tempf=26.1&" + "humidity=74&" + "dewptf=18.9&"
Expand Down Expand Up @@ -108,7 +108,7 @@ void a_request_with_an_unregistered_stationid_is_added_to_the_queue_once()
}

@Test
void multiple_indexed_parameters_of_the_same_channeltype_are_correctly_discovered() throws IOException {
void multipleIndexedParametersOfTheSameChanneltypeAreCorrectlyDiscovered() throws IOException {
// Given
final String queryString = "ID=dfggger&" + "PASSWORD=XXXXXX&" + "temp1f=26.1&" + "humidity=74&" + "temp2f=25.1&"
+ "lowbatt=1&" + "soilmoisture1=78&" + "soilmoisture2=73&" + "dateutc=2021-02-07%2014:04:03&"
Expand Down Expand Up @@ -152,7 +152,7 @@ void multiple_indexed_parameters_of_the_same_channeltype_are_correctly_discovere
}

@Test
void unregistered_channels_are_added_on_the_fly_when_discovered() throws IOException {
void unregisteredChannelsAreAddedOnTheFlyWhenDiscovered() throws IOException {
// Given
final String firstDeviceQueryString = "ID=dfggger&" + "PASSWORD=XXXXXX&" + "tempf=26.1&" + "humidity=74&"
+ "dateutc=2021-02-07%2014:04:03&" + "softwaretype=WH2600%20V2.2.8&" + "action=updateraw&"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;

import de.jollyday.config.With;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jetty.http.HttpFields;
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.server.HttpChannel;
import org.eclipse.jetty.server.Request;
import org.hamcrest.core.Is;
import org.jose4j.http.Get;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Answers;
Expand Down Expand Up @@ -99,7 +102,7 @@ public void setUp() {
}

@Test
void the_servlet_is_active_after_the_first_handler_is_added() throws ServletException, NamespaceException {
void theServletIsActiveAfterTheFirstHandlerIsAdded() throws ServletException, NamespaceException {
// Given
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(httpService, discoveryService);
WundergroundUpdateReceiverHandler handler = mock(WundergroundUpdateReceiverHandler.class);
Expand All @@ -114,7 +117,7 @@ void the_servlet_is_active_after_the_first_handler_is_added() throws ServletExce
}

@Test
void the_servlet_is_inactive_after_the_last_handler_is_removed_and_background_discovery_is_disabled()
void theServletIsInactiveAfterTheLastHandlerIsRemovedAndBackgroundDiscoveryIsDisabled()
throws ServletException, NamespaceException {
// Given
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(httpService, discoveryService);
Expand All @@ -138,7 +141,7 @@ void the_servlet_is_inactive_after_the_last_handler_is_removed_and_background_di
}

@Test
void the_servlet_is_active_after_the_last_handler_is_removed_but_background_discovery_is_enabled()
void theServletIsActiveAfterTheLastHandlerIsRemovedButBackgroundDiscoveryIsEnabled()
throws ServletException, NamespaceException {
// Given
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(httpService, discoveryService);
Expand All @@ -162,7 +165,7 @@ void the_servlet_is_active_after_the_last_handler_is_removed_but_background_disc
}

@Test
void on_dispose_all_handlers_are_removed_and_servlet_is_inactive() throws ServletException, NamespaceException {
void onDisposeAllHandlersAreRemovedAndServletIsInactive() throws ServletException, NamespaceException {
// Given
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(httpService, discoveryService);
WundergroundUpdateReceiverHandler handler1 = mock(WundergroundUpdateReceiverHandler.class);
Expand All @@ -187,7 +190,7 @@ void on_dispose_all_handlers_are_removed_and_servlet_is_inactive() throws Servle
}

@Test
void on_dispose_all_handlers_are_removed_and_servlet_is_inactive_even_though_background_discovery_is_enabled()
void OnDisposeAllHandlersAreRemovedAndServletIsInactiveEvenThoughBackgroundDiscoveryIsEnabled()
throws ServletException, NamespaceException {
// Given
WundergroundUpdateReceiverServlet sut = new WundergroundUpdateReceiverServlet(httpService, discoveryService);
Expand All @@ -214,7 +217,7 @@ void on_dispose_all_handlers_are_removed_and_servlet_is_inactive_even_though_bac
}

@Test
void changed_station_id_propagates_to_handler_key() throws ServletException, NamespaceException {
void changedStationIdPropagatesToHandlerKey() throws ServletException, NamespaceException {
// Given
Thing thing = mock(Thing.class);
when(thing.getUID()).thenReturn(TEST_THING_UID);
Expand Down Expand Up @@ -256,7 +259,7 @@ void changed_station_id_propagates_to_handler_key() throws ServletException, Nam
}

@Test
void a_get_request_is_correctly_parsed() throws IOException {
void aGetRequestIsCorrectlyParsed() throws IOException {
// Given
ThingUID testThingUID = new ThingUID(WundergroundUpdateReceiverBindingConstants.THING_TYPE_UPDATE_RECEIVER,
"test-receiver");
Expand Down Expand Up @@ -399,7 +402,7 @@ void a_get_request_is_correctly_parsed() throws IOException {
}

@Test
void a_get_request_with_indexed_parametres_are_correctly_parsed() throws IOException {
void aGetRequestWithIndexedParametresAreCorrectlyParsed() throws IOException {
// Given
ThingUID testThingUID = new ThingUID(WundergroundUpdateReceiverBindingConstants.THING_TYPE_UPDATE_RECEIVER,
"test-receiver");
Expand Down

0 comments on commit d0997b2

Please sign in to comment.